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
fix(experimental_createQueryPersister): Change persisterRestoreAll to restoreQueries with filter support (#9230)
* Add persisterRestoreByKey
* Fix imports
* Add missing return statement
* Fix test
* docs
* Add extra test
* Merge into single restoreQueries function
This function can be used to restore all queries that are currently stored by persister in one go.
117
-
For example when your app is starting up in offline mode, or you want data from previous session to be immediately available without intermediate `loading` state.
116
+
This function can be used to restore queries that are currently stored by persister.
117
+
For example when your app is starting up in offline mode, or you want all or only specific data from previous session to be immediately available without intermediate `loading` state.
118
+
119
+
The filter object supports the following properties:
120
+
121
+
-`queryKey?: QueryKey`
122
+
- Set this property to define a query key to match on.
123
+
-`exact?: boolean`
124
+
- If you don't want to search queries inclusively by query key, you can pass the `exact: true` option to return only the query with the exact query key you have passed.
118
125
119
126
For this function to work, your storage must expose `entries` method that would return a `key-value tuple array`.
120
127
For example `Object.entries(localStorage)` for `localStorage` or `entries` from `idb-keyval`.
0 commit comments