-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storage): added include and exclude matchers
- added sub-branch option to sync a sub-branch of state to storage
- Loading branch information
1 parent
8c9849b
commit 4afe572
Showing
2 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import { | ||
import type { | ||
BaseState, | ||
BranchAccessor, | ||
ReadState, | ||
} from '@harlem/core'; | ||
|
||
import type { | ||
Matchable, | ||
} from '@harlem/utilities'; | ||
|
||
export type StorageType = 'local' | 'session'; | ||
|
||
export interface Options<TState extends BaseState> { | ||
export interface Options<TState extends BaseState> extends Matchable { | ||
type: StorageType; | ||
prefix: string; | ||
sync: boolean; | ||
restore: boolean; | ||
exclude: string[]; | ||
serialiser(state: ReadState<TState>): string; | ||
parser(value: string): TState; | ||
branch: BranchAccessor<TState, unknown>; | ||
} |