diff --git a/README.md b/README.md
index a55d2ee..7ae5203 100644
--- a/README.md
+++ b/README.md
@@ -72,18 +72,21 @@ Instead of [reselect](https://github.com/reduxjs/reselect).
```js
import { useSelector } from 'react-redux';
-const selectTotal = memoize(({ state, id }) => ({
- total: state.a + state.b,
- title: state.titles[id]
-}))
+const getScore = memoize(state => ({
+ score: heavyComputation(state.a + state.b),
+ createdAt: Date.now(),
+}));
const Component = ({ id }) => {
- const { total, title } = useSelector(state => selectTotal({ state, id }));
- return
{total} {title}
;
+ const { score, title } = useSelector(useCallback(memoize(state => ({
+ score: getScore(state),
+ title: state.titles[id],
+ })), [id]));
+ return {score.score} {score.createdAt} {title}
;
};
```
-[CodeSandbox](https://codesandbox.io/s/proxy-memoize-demo-c1021)
+- [CodeSandbox 1](https://codesandbox.io/s/proxy-memoize-demo-c1021)
## Usage with Zustand
diff --git a/src/index.ts b/src/index.ts
index 1d1da3b..bea007a 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -2,11 +2,32 @@ import {
createDeepProxy,
isDeepChanged,
getUntrackedObject,
- trackMemo,
} from 'proxy-compare';
+type Affected = WeakMap