Skip to content

smelt.cell

Tier: Host — Available in every runtime, including headless mode.

Typed reactive cell registry. smelt.cell(name) returns a sticky Cell handle with :get, :set, :subscribe, :name. smelt.cell.new declares a cell with an initial value. smelt.cell.glob subscribes across every name matching a glob pattern.

smelt.cell.glob

fun(pattern: string, handler: fun(arg1: string, arg2: any)): smelt.Reg

Types: smelt.Reg

Register handler(name, value) for every cell whose name matches pattern (glob syntax). Returns a Reg whose :remove() drops the glob subscription.

smelt.cell.new

fun(name: smelt.cell.Name, initial: any): nil

Types: smelt.cell.Name

Declare a cell named name with initial as its starting value. No-op if the cell already exists.