live()
functionsince 0.1requires runtimeRe-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()andpick()inside it re-roll each time.- interval
msorsoptional - Default
1s, minimum50ms; 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;}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
- Live values · API examples, runs the real runtime
Related
Experimental · syntax may change between minor versions