Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fast-memoize from docs #663

Merged
merged 2 commits into from
Aug 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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