UNPKG

@activejs/core

Version:

Pragmatic, Reactive State Management for JavaScript Apps

35 lines (34 loc) 1.35 kB
/** * @internal * The prefix string for ids of persistent Units, applied when saving/retrieving value to/from persistent storage, * This is intended to avoid conflicts with other items in the storage that do not belong to ActiveJS, * and to identify items in the storage that belong to ActiveJS for features like {@link clearPersistentStorage} to work as intended. */ export declare const KeyPrefix = "_AJS_UNIT_"; /** * To clear persisted values of persistent Units from storage. * * Note: It does not clear the value of Units, only the persisted value is cleared. * * See {@link https://docs.activejs.dev/guides/persistence} for more details. * * @param storage The Storage from where the Units' persisted values need to be removed. \ * {@link Configuration.storage} is used as storage by default. \ * You can pass a reference to whichever storage you want to clean up. * @category Global */ export declare function clearPersistentStorage(storage?: Storage): void; /** * @internal please do not use. */ export declare function save<T>(key: string, value: T, storage?: Storage): void; /** * @internal please do not use. */ export declare function retrieve<T>(key: string, storage?: Storage): { value: T; } | null; /** * @internal please do not use. */ export declare function remove<T>(key: string, storage?: Storage): void;