Skip to content

Lobbies · Search params & storage

14 modules · 73 exports · 2 repositories · 67 e2e tests · 3 routes

The state Lobbies keeps in the URL and in the browser's storage. Every param has a default and never fails to decode, see Search params, and each definition should have an assertRoundTrips test. The definitions of the whole app are listed in the reference.

Search params

URL lobbiesSearchParams

app/features/lobbies/lobbies-search-params.ts:7

ParamValueDefaultLoaderDescription
tab v.nullable(v.picklist(LOBBY_INDEX_TABS))nullfalse

null = the tab with the viewer's own lobby, or else the first non-empty one

Used in lobbies.tsx

URL lobbySearchParams

app/features/lobbies/lobbies-search-params.ts:12

ParamValueDefaultLoaderDescription
key v.nullable(v.pipe(v.string(), v.length(SHORT_NANOID_LENGTH)))nulltrue

Share key of a link-only lobby, letting those not participating see it

Used in lobbies.$id.server.tslobbies.$id.server.tslobbies-utils.ts

URL newLobbySearchParams

app/features/lobbies/lobbies-search-params.ts:19

ParamValueDefaultLoaderDescription
lobbyId v.nullable(v.pipe(v.number(), v.integer(), v.gtValue(0)))nulltrue

The lobby the host is editing, null = making a new one

Used in lobbies.new.server.tslobbies-utils.ts