Files
tiny-worlds/web/state.mjs
T

15 lines
554 B
JavaScript
Raw Normal View History

// web/state.mjs — the shared runtime state.
//
// Deliberately small: auth (me), the render sequence (seq — the
// async race guard; a view captures it at enter and checks it after
// every await), and the currently addressed run (runId — setup and
// play both write here; saves address it). Everything else is
// module-local to the view or widget that owns it.
export const state = {
view: null, // the active view name ('claim' | 'home' | ...)
seq: 0,
me: null, // the signed-in user ({ id, name, superuser }) or null
runId: null,
};