platform/node/session-store
Classes
Section titled “Classes”JsonFileSessionStore
Section titled “JsonFileSessionStore”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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new JsonFileSessionStore(
path,clock,debounceMs?):JsonFileSessionStore
Defined in: app/src/platform/node/session-store.ts:26
Parameters
Section titled “Parameters”string
Path of session.json.
Schedules the writes.
debounceMs?
Section titled “debounceMs?”number = 1000
Delay before a write.
Returns
Section titled “Returns”Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose():
void
Defined in: app/src/platform/node/session-store.ts:69
Cancels a scheduled write. Call JsonFileSessionStore.flush first.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”flush()
Section titled “flush()”flush():
Promise<void>
Defined in: app/src/platform/node/session-store.ts:57
Writes a pending session now, for example while the browser quits.
Returns
Section titled “Returns”Promise<void>
read()
Section titled “read()”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.
Returns
Section titled “Returns”Promise<unknown>
schedule()
Section titled “schedule()”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.
Parameters
Section titled “Parameters”session
Section titled “session”The tabs of the open windows.
version
Section titled “version”1 = ...
windows
Section titled “windows”object[] = ...
Returns
Section titled “Returns”void