ReadonlygetRead the current state. Always returns the same reference until it changes.
ReadonlysetApply an updater. If the updater returns a new reference, listeners are notified; if it returns the same reference, nothing fires (cheap no-op).
ReadonlysubscribeSubscribe to state changes. Returns an unsubscribe function.
ReadonlylistenerNumber of active subscribers — useful for leak tests.
The internal store backing every Game. You'll rarely instantiate this directly —
createGamewraps it — but it's exported so you can use it as a building block (e.g., for non-game UIs or for tests).All methods are bound, so destructuring is safe: