Skip to content

indexedStore beta ​

Function of @v12-engine/client

ts
export declare function indexedStore<R extends {
    id: string;
}>(database: string, name: string, heavy?: keyof R, storage?: KeptStorage): Store<R>;

A store in IndexedDB: one object store of records, in a database of its own under the app's name (storage, its runtime's: KeptStorage.database; the page's when left out). Each call opens the database and closes it again. With no IndexedDB (a page made in a test, a server that draws a map), nothing is kept and nothing is listed.

Given the heavy field of a record (the world of a save, the data of a replay), it keeps the record without it in a second object store beside, and heads() lists those: a list of the saves reads no world. Records kept before that are given theirs the first time heads() is asked