Skip to content

platform/node/session-store

Defined in: app/src/platform/node/session-store.ts:13

Keeps the session in session.json: written atomically, at most once per second while tabs change, and at once when the browser quits. The previous file stays as session.json.bak, which is read when the current file is broken.

new JsonFileSessionStore(path, clock, debounceMs?): JsonFileSessionStore

Defined in: app/src/platform/node/session-store.ts:26

string

Path of session.json.

Clock

Schedules the writes.

number = 1000

Delay before a write.

JsonFileSessionStore

dispose(): void

Defined in: app/src/platform/node/session-store.ts:69

Cancels a scheduled write. Call JsonFileSessionStore.flush first.

void

Disposable.dispose

flush(): Promise<void>

Defined in: app/src/platform/node/session-store.ts:57

Writes a pending session now, for example while the browser quits.

Promise<void>

read(): Promise<unknown>

Defined in: app/src/platform/node/session-store.ts:33

Reads the stored session, or the backup when the file is broken; undefined if none.

Promise<unknown>

schedule(session): void

Defined in: app/src/platform/node/session-store.ts:48

Stores a session after the delay; a newer session replaces a pending one.

The tabs of the open windows.

1 = ...

object[] = ...

void