resourcerer 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -932,7 +932,14 @@ function MyComponent(props) {
|
|
|
932
932
|
return <Button onClick={() => invalidate(["todos"])}>Invalidate me</Button>;
|
|
933
933
|
```
|
|
934
934
|
|
|
935
|
-
* Unlike [`refetching`](#refetching), the ResourceKeys passed to `invalidate` do not need to be from those returned by the executor function. They can any resource key.
|
|
935
|
+
* Unlike [`refetching`](#refetching), the ResourceKeys passed to `invalidate` do not need to be from those returned by the executor function. They can any resource key. This function is also available as a static import from the `resourcerer` package.
|
|
936
|
+
|
|
937
|
+
Rather than invalidating the cache for select keys, you can also invalidate the entire cache with the exception of some keys by passing the `{except: true}` option:
|
|
938
|
+
|
|
939
|
+
```js
|
|
940
|
+
// this will remove all items from the cache except those from the "todos" resource
|
|
941
|
+
invalidate(["todos"], {except: true});
|
|
942
|
+
```
|
|
936
943
|
|
|
937
944
|
## Tracking Request Times
|
|
938
945
|
|