11 Commits

Author SHA1 Message Date
Fabrizio Vitale
3cbd468fe5
feat: add useShallow (#2090)
* feat: add useShallow

See
- https://github.com/pmndrs/zustand/discussions/1937
- https://github.com/pmndrs/zustand/discussions/1937#discussioncomment-7118242
- https://github.com/pmndrs/zustand/discussions/1937#discussioncomment-6974554

* chore(useShallow): improve unit tests

* chore(useShallow): PR feedback https://github.com/pmndrs/zustand/pull/2090#discussion_r1341963105

* fix(useShallow): tests not working on test_matrix (cjs, production, CI-MATRIX-NOSKIP)

* chore(useShallow): fix eslint warning issue (unused import)

* refactor(useShallow): simplify tests

* docs(useShallow): add guide

* fix(useShallow): prettier:ci error https://github.com/pmndrs/zustand/actions/runs/6369420511/job/17289749161?pr=2090

* docs(useShallow): update readme

* docs(useShallow): remove obsolete line from readme

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>

* doc(useShallow): PR feedback https://github.com/pmndrs/zustand/pull/2090#discussion_r1342120701

* docs(useShallow): small improvements of the useShallow guide

---------

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2023-10-02 22:13:13 +09:00
Arjun Vegda
496a466c2c
chore(tests): migrate to vitest (#1753)
* test: migrate to vitest

* test: try #1 remove CI-MATRIX tags

* test: try 2 remove import/require replace

* chore: remove unused scripts/assignments

* chore(test-multiple-builds.yml): remove import/require replace script

* fix merging main

---------

Co-authored-by: daishi <daishi@axlight.com>
2023-05-04 13:25:24 +09:00
Daishi Kato
9062ca634f
chore: remove __DEV__ with ts-jest (#1598)
* wip: use ts-jest instead of swc/jest

* use esm in jest

* remove types/jest

* remove __DEV__

* fix rollup config

* fix github workflow

* hack jest.Mock

* wip: ts

* skipLibCheck for older ts 2

* wip: ts

* wip: workflow...

* wip: workflow...

* wip: workflow...

* experiment...

* experiment...2

* experiment...3

* experiment...4

* jest preset
2023-02-10 19:05:12 +09:00
Daishi Kato
0b55a3d74b
feat: deprecate default export (#1514) 2023-01-10 18:13:25 +09:00
Anton
ed526d074b
feat(shallow): Add support of Maps and Sets to shallow comparator (#1451)
* Add support of Maps and Sets to shallow comparator.

* Update src/shallow.ts

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2022-12-05 21:28:28 +09:00
Daishi Kato
fa581ddd9b
fix(docs): useBoundStore instead of useStore (#1125)
* fix(docs): useBoundStore instead of useStore

* run prettier
2022-07-26 08:58:43 +09:00
Daishi Kato
0938b17a77
fix(shallow): types with useStore again (#1117)
* add failing test

* avoid function overload

* simplify types

* add unsupported test cases

* Update src/shallow.ts

* run prettier
2022-07-21 08:15:06 +09:00
Daishi Kato
05a4c15cea
fix(shallow): types with useStore (#1108)
* fix(shallow): types with useStore

* refactor: simplify types by adding more restrictions
2022-07-20 08:48:57 +09:00
Timoteo
f949d04ff2
tests(shallow): Compare functions test was added (#1071)
* feat: compare functions test was added

* run prettier to formate code
2022-07-11 12:20:43 +09:00
Daishi Kato
ae86695c44
refactor(test): use aliases (#571) 2021-09-29 00:55:12 +09:00
David Dios
97db4c5a15
Fix shallow types and add shallow test (#189)
* support object array comparison in shallow

* move shallow.test.ts to shallow.test.tsx

* revert shallow

Co-authored-by: daishi <daishi@axlight.com>
2020-09-12 09:16:03 +09:00