MCPcopy Create free account
hub / github.com/Effect-TS/effect / readState

Function readState

packages/effect/src/ui/Router.ts:1841–1848  ·  view source on GitHub ↗
(state: unknown)

Source from the content-addressed store, hash-verified

1839const stateKey = "effect/ui"
1840
1841const readState = (state: unknown): EntryState | undefined => {
1842 if (typeof state !== "object" || state === null) return undefined
1843 const value = (state as Record<string, unknown>)[stateKey]
1844 return typeof value === "object" && value !== null &&
1845 typeof (value as EntryState).index === "number"
1846 ? value as EntryState
1847 : undefined
1848}
1849
1850const writeState = (entry: EntryState): unknown => ({ [stateKey]: entry })
1851

Callers 3

buildFunction · 0.85
navigateFunction · 0.85
poppedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected