mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat(core): new async global state storage impl (#11794)
This commit is contained in:
10
packages/common/infra/src/storage/async-memento.ts
Normal file
10
packages/common/infra/src/storage/async-memento.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { type Observable } from 'rxjs';
|
||||
|
||||
export interface AsyncMemento {
|
||||
watch<T>(key: string): Observable<T | undefined>;
|
||||
get<T>(key: string): Promise<T | undefined>;
|
||||
set<T>(key: string, value: T | undefined): Promise<void>;
|
||||
del(key: string): Promise<void>;
|
||||
clear(): Promise<void>;
|
||||
keys(): Promise<string[]>;
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './async-memento';
|
||||
export * from './kv';
|
||||
export * from './memento';
|
||||
|
||||
Reference in New Issue
Block a user