Skip to content

Commit

Permalink
Remove fast-memoize from docs (#663)
Browse files Browse the repository at this point in the history
* improve memoize docs

* fix link
  • Loading branch information
mfbx9da4 authored and jmyrland committed Sep 16, 2022
1 parent c98f5fd commit cb5330d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/docs/docs/api/computed.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ function Todo({ id }) {
Note that only the function that you return will be memoized. If you wish to
memoize the results from the function itself you will need to utilize a
memoization utility, such as
[`fast-memoize`](https://github.com/caiogondim/fast-memoize.js).
[`memoizerific`](https://github.com/thinkloop/memoizerific).

```javascript
import memoize from 'fast-memoize';
import memoize from 'memoizerific';

const todos = {
items: [{ id: 1, text: 'answer questions' }],

todoById: computed((state) => {
// Wrap the returned function with the memoize utility
// 👇
return memoize((id) => state.items.find((todo) => todo.id === id));
return memoize((id) => state.items.find((todo) => todo.id === id), 1);
}),
};
```
Expand Down

0 comments on commit cb5330d

Please sign in to comment.