You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -97,25 +124,26 @@ An interface defining the configuration attributes to bootstrap `localStorageSyn
97
124
*`syncCondition` (optional) `(state) => boolean`: When set, sync to storage medium will only occur when this function returns a true boolean. Example: `(state) => state.config.syncToStorage` will check the state tree under config.syncToStorage and if true, it will sync to the storage. If undefined or false it will not sync to storage. Often useful for "remember me" options in login.
98
125
*`checkStorageAvailability`\(*boolean? = false*): Specify if the storage availability checking is expected, i.e. for server side rendering / Universal.
99
126
*`mergeReducer` (optional) `(state: any, rehydratedState: any, action: any) => any`: Defines the reducer to use to merge the rehydrated state from storage with the state from the ngrx store. If unspecified, defaults to performing a full deepmerge on an `INIT_ACTION` or an `UPDATE_ACTION`.
127
+
*`forFeature`\(*boolean? = false*): Specify if the storage sync should be performed for a feature store.
100
128
101
129
### Usage
102
130
103
131
#### Key Prefix
104
132
105
133
```ts
106
134
localStorageSync({
107
-
keys: ['todos', 'visibilityFilter'],
108
-
storageKeySerializer: (key) =>`cool_${key}`,
135
+
keys: ['todos', 'visibilityFilter'],
136
+
storageKeySerializer: (key) =>`cool_${key}`,
109
137
});
110
-
```
138
+
```
111
139
In above example `Storage` will use keys `cool_todos` and `cool_visibilityFilter` keys to store `todos` and `visibilityFilter` slices of state). The key itself is used by default - `(key) => key`.
0 commit comments