Skip to main content

globalChanges

@zylem/game-lib


@zylem/game-lib / globals / globalChanges

Function: globalChanges()

globalChanges<T>(keys, callback): (ctx) => void

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

Listen for multiple global key changes inside an onUpdate pipeline. Calls back when any of the provided keys changes. Usage: onUpdate(globalChanges(['p1Score','p2Score'], ([p1,p2]) => { ... }))

Type Parameters​

T​

T = any

Parameters​

keys​

string[]

callback​

(values, ctx) => void

Returns​

(ctx) => void