readHeldWorld
readHeldWorld(
world):HeldWorld|null
The persistent world this page or room holds, as the directory names
it: its id, name, owner, region, settings and listing; null in a room
that holds none, in a game played alone that keeps no worlds, and
before the platform’s first answer. Outside the app, as under
spawnite dev, a game played alone that keeps worlds holds the
stand-in world dev. It reads the same in the room and on each page,
where useHeldWorld is its hook. The world it takes
is the simulation, the room’s or the page’s. Every player in the room
can read it, its settings included, so a secret belongs in the world’s
record.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
Returns
Section titled “Returns”HeldWorld | null
Example
Section titled “Example”const held = readHeldWorld(world); if (held?.isCreatorOwned) allowVisitorsToBuild(step);