LOGIC

Functions

Use fn to name target-neutral reactive behavior and dispatch it from a component event.

INTERACTIVE EXAMPLE

Name a state transition

A function contains one declarative request, set, or reset operation.

The Button dispatches togglePanel, which updates this page Signal.

dowe
signal panelOpen value:false

fn togglePanel
  set panelOpen value:!panelOpen

Button onClick:togglePanel
  "Toggle panel"