(state: unknown)
| 1839 | const stateKey = "effect/ui" |
| 1840 | |
| 1841 | const 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 | |
| 1850 | const writeState = (entry: EntryState): unknown => ({ [stateKey]: entry }) |
| 1851 |