Lavash.Actions.Set (Lavash v0.4.0-rc.3)

Copy Markdown View Source

Sets a field to a value.

The value expression uses @field syntax to reference state and params, aligned with template syntax. At compile time, the expression is stored as both source (for JS transpilation) and a transformed function (for server-side evaluation).

Examples

set :count, @count + 1
set :items, @items ++ [@name]
set :total, @price * @quantity