Closed dai-shi closed 3 years ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit a2c3c98f95205c3f767c29744aa2da3d68e916b4:
Sandbox | Source |
---|---|
React | Configuration |
React Typescript | Configuration |
@axelboc Would you try the codesandbox build (you can install it locally)? Also feel free to review code.
Works like a charm! I was able to remove my wrapper store and just pass { type: 'Map', areEqual }
with a tiny comparator function of my own making. I wasn't able to use zustand's shallow
comparator because I want { foo: undefined; }
to be considered the same as {}
, which confirms the flexibility of the new API design.
All my tests are passing, and nothing jumps out from your code. Thanks a lot!! 🚀
fix #18
This allows new cache type with custom comparator. The function signature is changed, so this is breaking change.