Documentation / @etherfold/browser / generationRegistryPortOnIndexedDB
Function: generationRegistryPortOnIndexedDB() ​
generationRegistryPortOnIndexedDB(
name,options):GenerationRegistryPort
Defined in: packages/browser/src/storage/generation/OnIndexedDB.ts:90
The five substrate operations, over one UseStore and ONE named indexer.
commit is a RAW readwrite transaction that reads the records, applies the registry's decision and writes, and NOT a read followed by a write: two tabs that both read "one generation, a cap of two" and then both wrote would leave three generations under a cap of two, with nothing afterwards able to detect it. IndexedDB serialises overlapping readwrite transactions on one object store, across tabs, so that is all the mutual exclusion this needs. It is the same rule the stream keeper's commit follows, including its one constraint: inside a transaction you may await only IndexedDB's own promises.
Parameters ​
name ​
string
options ​
dropState ​
(id) => Promise<void>
readStateCursor? ​
(id) => Promise<number | undefined>
store? ​
UseStore