fix(lib/json-storage): clarify how JsonStorage.get() and JsonStorageUpdateMode.Load works
This commit is contained in:
parent
9e2ac7185d
commit
e73bbc03ba
1 changed files with 4 additions and 2 deletions
|
|
@ -34,7 +34,8 @@ export const JsonStorageUpdateMode = {
|
|||
*/
|
||||
Replace: 1,
|
||||
/**
|
||||
* Same behavior as {@link JsonStorageUpdateMode.Replace}, but for the intial load of the storage.
|
||||
* Same behavior as {@link JsonStorageUpdateMode.Replace}, but for when the storage is being synced from disk.
|
||||
* E.g. on initial load, or when the storage file is deleted and recreated.
|
||||
*/
|
||||
Load: 2,
|
||||
} as const
|
||||
|
|
@ -221,7 +222,8 @@ export interface JsonStorage<T extends AnyObject> {
|
|||
*/
|
||||
subscribe(callback: JsonStorageSubscription<T>): () => void
|
||||
/**
|
||||
* Get the storage.
|
||||
* Reads the storage from disk.
|
||||
* If the storage does not exist, it will be created with the default value.
|
||||
*/
|
||||
get(): Promise<T>
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue