KeptStorage beta
Class of @v12-engine/client
ts
export declare class KeptStorageWhat an app keeps in the browser, under its name (prefix): made by its runtime (ClientRuntime.storage), so that two apps, on one origin or one page, each keep their own
Members
constructor
ts
constructor(
prefix?: string);Constructs a new instance of the KeptStorage class
database
ts
database(name?: string): string;The name of a database of the app (IndexedDB): v12, or v12-saves for one of its own
keep
ts
keep(name: string, value: string | null, options?: {
where?: Area;
}): void;Keeps something under a name; nothing is kept where the browser keeps nothing. null forgets it
key
ts
key(name: string): string;The key a thing is kept under: v12:mix
prefix
ts
readonly prefix: string;The name everything kept goes under: the app's own, like my-game
read
ts
read(name: string, options?: {
legacy?: string;
where?: Area;
}): string | null;What is kept under a name, or null. legacy is the key it was kept under before it had the prefix: read when there is nothing under the new one, so that nothing kept is lost