gizlang:live
State that survives code changes. Under giz live, each new generation of the program sees the same named state; when the state's type changed, fields whose name and type are unchanged keep their values and the others start from initial.
import * as Live from "gizlang:live";Functions
state
function state<T>(name: string, initial: T): Ref<T>The value cell NAME, kept across live reloads of the program: its first use makes it with INITIAL.
generation
function generation(): i64The number of the newest live generation: 1, 2, ... under giz live, 0 elsewhere. A program that keeps a value made at its
start sees by a changed number that a new generation took over.
Effects: read.
reject
function reject(): boolA deployed host withdraws the generation that runs, because it cannot start (its startup failed): the one before it serves again. Whether it did; false on a development host and outside a live host.
Effects: write.
buildError
function buildError(): stringWhy the newest edit did not build under giz live: the compiler's diagnostics, as the terminal shows them.
Empty when it built, and outside a live host. A development page shows it until an edit fixes it.
Effects: fail, read.