Skip to content

Commit

Permalink
docs: automatic rerender
Browse files Browse the repository at this point in the history
  • Loading branch information
ph-fritsche committed Jan 21, 2021
1 parent 6287ea3 commit 17a0255
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 17a0255

Please sign in to comment.