Skip to content

Documentation / @etherfold/browser / DemotableWriter

Type Alias: DemotableWriter ​

DemotableWriter = object

Defined in: packages/browser/src/demotion.ts:100

WHAT A DEMOTION NEEDS OF THE WRITER IT DEMOTES: three verbs and no state.

A port rather than a concrete indexer, because the two callers that matter reach the same three things by different routes (the hook's own loop today, a lease holder tomorrow) and because the ORDER they run in is this function's guarantee rather than each caller's to remember.

Methods ​

forgetCursor() ​

forgetCursor(): void

Defined in: packages/browser/src/demotion.ts:117

DROP the in-memory cursor and everything derived from it.

The cursor is the dangerous half: a writer holding a stale LastSync is how a recorded position moves BACKWARDS, and checkTxInclusion answers from that window, so keeping it would have this tab report a transaction as indexed against a window nothing is maintaining.

Returns ​

void


stopFolding() ​

stopFolding(): void

Defined in: packages/browser/src/demotion.ts:108

STOP: no further fetch, no further fold, now.

First, always. A writer that narrowed its handle while its loop was still running would go on issuing the very mutations the demotion exists to stop, and would be refused for each of them.

Returns ​

void


stores() ​

stores(): Iterable<WritableStateStore>

Defined in: packages/browser/src/demotion.ts:119

The state stores this writer was folding into, which become reads.

Returns ​

Iterable<WritableStateStore>