246 Commits

Author SHA1 Message Date
Jeremy Holcomb
acbc18535c
Fix subscribers being overwritten between render and effect (#91) 2020-02-19 22:56:47 -08:00
JeremyHolcomb
2979e0df4b Fix comment typo 2020-01-06 20:43:16 -08:00
JeremyHolcomb
a3201f8a19 Fix subscriber being overwritten on sync state updates 2020-01-06 19:46:53 -08:00
Zhongliang Wang
70ad63b79b Fix type inference of TypeScript for shallow by removing any (#80) 2019-12-01 22:36:55 -08:00
Paul Henschel
f87534e444 fix #72 2019-10-30 08:37:09 +01:00
Jeremy Holcomb
487dd317b3
Make StateListener simple type and clean up build configs (#69)
* Clean up build/update deps

* Fix StateListener type
2019-10-24 07:02:04 -07:00
Jeremy Holcomb
d82e103cc6
2.1.0: Type changes and perf/bug fixes. (#66)
Removed SubscribeOptions & UseStoreSubscribeOptions types.
Added Subscriber type.
Improve performance by consolidating sparse array.
Fix potential issue with concurrent mode.
2019-10-11 09:09:14 -07:00
Jeremy Holcomb
e77ab242c8
Zustand 2.x // Ensure order of subscribers (#65)
* Ensure order of subscribers matches render order

* Update size snapshot

* Fix shallow and middleware output

* Update devDependencies

* Only show devtools warning in dev mode

* Allow setting action name in middleware

* Update tests

* Update subscriber order logic

* 2.0.0

* Update subscribe signature

* Remove useEffect import in tests

* Change api.subscribe signature
2019-10-09 11:37:49 -07:00
Dmitriy Chuvichkin
61712e91c3 Adjust type inference for store without a selector (#59)
* Adjust type inference for store without a selector

* Remove `ReturnType`; Modify UseStore by two call signatures
2019-09-09 15:27:44 -07:00
JeremyHolcomb
256b701c7c Fix RefError when calling subscribe in middleware 2019-08-22 19:54:36 -07:00
paulshen
21dc94ddcd fix forceUpdate 2019-08-21 11:03:46 -07:00
Paul Henschel
98e5eff481 fix #53 2019-08-15 14:22:02 +02:00
JeremyHolcomb
5569f0b6bf Remove manual check of passed State generic 2019-07-20 14:17:52 -07:00
Paul Henschel
6ecca96f65 #41 devtools prefix, ship shallowequal in its own export 2019-06-30 17:57:46 +02:00
Paul Henschel
04e6df9bd8 make zustand 1.x more or less backwards compatible 2019-06-28 23:09:09 +02:00
Gabriel West
b87b0212f0 Add IIFE build 2019-06-28 21:30:52 +01:00
JeremyHolcomb
a06abb5c09 Rerun selector on error 2019-06-28 10:21:00 -07:00
JeremyHolcomb
b0d42c1537 Remove shallowEqual, change subscribe signature, add tests 2019-06-27 18:53:37 -07:00
Paul Henschel
15b630464d make middleware an extra export 2019-06-25 12:57:25 +02:00
Paul Henschel
4c953cf9fa make middleware official 2019-06-25 12:54:09 +02:00
Paul Henschel
14f3f95cc7 first draft 2019-06-25 12:12:25 +02:00
JeremyHolcomb
abb58935f6 Update deps, make set & get types use generic state, add initial middleware test 2019-06-22 12:55:31 -07:00
Paul Henschel
e73de520bd put everything into the dist folder 2019-06-22 17:52:33 +02:00
Paul Henschel
25194f9ee9 Merge branches 'master' and 'master' of https://github.com/drcmda/zustand 2019-06-22 17:35:53 +02:00
Paul Henschel
464cc6e440 set up default middleware 2019-06-22 17:35:51 +02:00
codemilli
0e90ee1987 Replace useLayoutEffect to useEffect in server side to fix ssr issue 2019-06-23 00:32:35 +09:00
Paul Henschel
faca6ec1b5 add api as a 3rd arg to create, this allows middleware to change it 2019-06-05 00:01:06 +02:00
JeremyHolcomb
6be659c28b Remove partial shallow equal check when no selector used 2019-06-02 07:38:05 -07:00
JeremyHolcomb
546201f077 Add selector to api.subscribe 2019-05-31 17:49:50 -07:00
Luxizzle
a337a2a893 Remove return types as they are now resolved correctly 2019-05-29 19:51:17 +02:00
Luxizzle
17a0f00486 Update createState as generics are now gone 2019-05-29 19:50:44 +02:00
Luxizzle
656437a1b4 Add return type for useStore 2019-05-29 19:49:57 +02:00
Luxizzle
79dc424881 Remove set and get generics 2019-05-29 19:49:36 +02:00
Luxizzle
141dd8c417 Seperate state selection with dependencies from non state selection in UseStore 2019-05-29 19:49:05 +02:00
Luxizzle
b095e8cd63 Improve Typescript types and generics 2019-05-21 15:06:19 +02:00
JeremyHolcomb
f967700c30 Simplify memoized selector and useLayoutEffect to prevent missed updates 2019-05-12 00:23:23 -07:00
JeremyHolcomb
33695164f2 Add documentation on dependencies 2019-05-11 23:23:01 -07:00
JeremyHolcomb
623d137813 Fix deps ref not being updated 2019-05-11 14:40:28 -07:00
JeremyHolcomb
257ac06a84 Fix optional deps locking state 2019-05-11 12:16:22 -07:00
JeremyHolcomb
1b6dae9fe5 Add optional dependencies for selector 2019-05-10 10:51:53 -07:00
JeremyHolcomb
d309de7bb0 Remove unnecessary subscribe callback code 2019-05-10 09:31:08 -07:00
JeremyHolcomb
61871b0c80 Update state slice when selector changes 2019-05-10 09:02:16 -07:00
JeremyHolcomb
b453191f7e Update refs in useEffect. Add more tests 2019-04-29 08:16:39 -07:00
JeremyHolcomb
9584223622 Add TypeScript 2019-04-17 19:30:57 -07:00
Umeayo Onyekachukwu
30a2385dfa added shallowEqual util from react-redux 2019-04-14 11:58:12 +01:00
Paul Henschel
0a88672c16 tests first draft, fix #5 2019-04-13 22:35:23 +02:00