Documents v0.9.0 · previews run the real runtime · experimental features are marked exp

live()

functionsince 0.1requires runtime

Re-evaluates an expression on an interval.

On this page · 9 sections+

Syntax

live(<expression>, <interval>?)

registry syntax: live(expression, interval = 1s)

Parameters

expressionany valuerequired
random() and pick() inside it re-roll each time.
intervalms or soptional
Default 1s, minimum 50ms; smaller values are raised with a warning.

Return value

The value of the expression.

Example

blink.cssreactive
.light {  background: live(pick(#f2542d, #57534e), 800ms);  transition: background 300ms;}
live()Function · hover any red tokenRe-evaluates an expression on an interval.Reference →

Behavior

  • One shared timer per distinct interval; a 2 s interval wakes 0.5 times per second.
  • Missed ticks are skipped, and periodic work stops while the tab is hidden.

Supported contexts

  • Any value.

Limitations

    Examples

    Experimental · syntax may change between minor versions