From 17a0255120ba6f865b5bef28aa3d7a576c004f7e Mon Sep 17 00:00:00 2001 From: Philipp Fritsche Date: Thu, 21 Jan 2021 14:16:43 +0100 Subject: [PATCH] docs: automatic rerender --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bdb5d66..59c6a0f 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,12 @@ If a `loader` is present, it will be called with the missing keys and those keys } ``` +#### Automatic rerender + +If a component calls `get()` for some keys it subscribes to further changes to that entry. +When this or any other components alters that entry through one of the writing methods described below, +the component automatically rerenders. + ### Set #### Set a single value @@ -217,7 +223,8 @@ You can set values in the react cache but not in IndexedDB: ``` #### Filter entries per callback -Clears the cache and also deletes some data from IndexedDB. + +Deletes some data from cache and IndexedDB. ```js const { clear } = useCached() clear(({data, meta}) => meta.someMetaField > 2) // this will remove all entries with meta.someMetaField > 2