Type Alias: SyncConfig<State>
SyncConfig<
State
>:object
Defined in: libs/ngrx-toolkit/src/lib/storage-sync/with-storage-sync.ts:28
Type Parameters
• State
Type declaration
autoSync?
optional
autoSync:boolean
Flag indicating if the store should read from storage on init and write to storage on every state change.
true
by default
key
key:
string
The key which is used to access the storage.
parse()?
optional
parse: (stateString
) =>State
Function used to parse the state coming from storage.
JSON.parse()
by default
Parameters
stateString
string
Returns
State
select()?
optional
select: (state
) =>Partial
<State
>
Function to select that portion of the state which should be stored.
Returns the whole state object by default
Parameters
state
State
Returns
Partial
<State
>
stringify()?
optional
stringify: (state
) =>string
Function used to transform the state into a string representation.
JSON.stringify()
by default
Parameters
state
State
Returns
string