Skip to main content

variableChange

@zylem/game-lib


@zylem/game-lib / globals / variableChange

Function: variableChange()

variableChange<T>(key, callback): (ctx) => void

Defined in: packages/game-lib/src/lib/actions/global-change.ts:54

Listen for a single stage variable change inside an onUpdate pipeline. Usage: onUpdate(variableChange('score', (value, ctx) => { ... }))

Type Parameters​

T​

T = any

Parameters​

key​

string

callback​

(value, ctx) => void

Returns​

(ctx) => void