612 Commits

Author SHA1 Message Date
Arnaud de Surirey
0ce421ced7
fix: useUpdateEffect returns optional cleanup function 2020-01-07 19:08:38 +01:00
streamich
777865c3ac feat: 🎸 add [vertical] flag to useSlider() hook 2020-01-03 19:53:12 +01:00
streamich
1980d46199 refactor: 💡 don't use useMeassure in useSlider hook 2020-01-03 19:46:16 +01:00
streamich
1e379e4966 chore: 🤖 catch up with master 2020-01-03 19:38:07 +01:00
streamich
d2c74f2763 chore: 🤖 resolve conflicts 2019-12-27 12:36:05 +01:00
streamich
8662dd0615 chore: 🤖 add new hooks to README, and minor tweaks to warnings 2019-12-27 12:33:08 +01:00
Anton Dosov
4f35605423 add useShallowCompareEffect and useCustomCompareEffect 2019-12-27 14:31:52 +03:00
Anton Dosov
e1f4252a1a improve shallow compare. test for array wil multiple deps 2019-12-27 13:53:14 +03:00
Anton Dosov
c4911e6d70 add use-shallow-compare-effect and use-custom-compare-effect 2019-12-27 13:04:39 +03:00
Vadim Dalecky
208b869f97
Merge pull request #827 from stefanbugge/pr/808-fix-useset-outdated-closure
fix(useSet): "has" method in useSet updated to reference latest set object
2019-12-10 02:45:55 -08:00
Stefan Loeschcke
4f1d8c2cbd fix(useSet): "has" method in useSet updated to reference latest set object 2019-12-10 09:48:00 +01:00
Anton Zinovyev
2832b7a37e
chore: move all stories from src directory. (#715)
chore: clean tsconfig.json;

feat: updated webpack config to export a function to achieve full-control mode, instead of deprecated Extend Mode;
2019-12-09 23:36:40 +03:00
Vadim Dalecky
7cf955d6ed
Merge pull request #826 from stefanbugge/pr/816-fix-actions-not-stable-across-renders
fix(useMap): methods with side effects should be stable across renders.
2019-12-09 06:07:18 -08:00
Anton Zinovyev
125c7e96a1
feat: useScrollbarWidth hook; (#825)
* feat: useScrollbarWidth hook;

* chore: bump @xobotyi/scrollbar-width to 1.5.0 and add it to dependencies.

* fix: remove @xobotyi/scrollbar-width from dev-deps.
2019-12-09 15:47:44 +03:00
Stefan Loeschcke
020b4dbc6c fix(useMap): methods with side effects should be stable across renders. 2019-12-09 11:11:14 +01:00
streamich
28ef34b4c7 docs: ✏️ add useUnmountedPromise reference 2019-12-08 00:54:58 +01:00
streamich
797e54c33b test: 💍 add useUnmountPromise() tests 2019-12-08 00:46:40 +01:00
streamich
01421bc634 feat: 🎸 add useUnmountPromise hook 2019-12-07 20:04:02 +01:00
Vadim Dalecky
ca43b80357
refactor: simplify counter increment in useUpdate 2019-12-06 00:14:10 +01:00
Olzhas Alexandrov
93e72910ab fix: useUpdate hitting maxInt, failing to trigger rerender
Signed-off-by: Olzhas Alexandrov <olzhas@alexandrov.co>
2019-12-05 17:04:09 -06:00
Stefan Loeschcke
044d2677aa fix: "get" method in useMap updated to reference latest map object 2019-12-03 12:06:41 +01:00
Anton Zinovyev
0a66359143
feat: useStateHistory (#709)
* feat: add useStateHistory hook;
* fix: createBreakpoint lint fix (author skipped hooks);
2019-11-28 16:41:48 +03:00
Anton Zinovyev
30abe2b22e
feat: add useFirstMountState & useRendersCount hooks (#769)
feat(useFirstMountState): hook to track if render is first;
feat(useRendersCount): hook to track renders count;
refactor(useUpdateEffect): now uses useFirstMountState hook;
refactor(usePreviousDistinct): now uses with useFirstMountState hook;
docs: update readme;
2019-11-23 15:14:35 +03:00
xobotyi
75284c62c8 fix(#792): make useUnmount invoke the current callback version instead of very first 2019-11-22 13:49:21 +03:00
Nicolas DUBIEN
022fa0b7b7 fix: useAsyncFn does not discard old promises and might produce races 2019-11-21 00:48:10 +01:00
Vinit
1811908bd6 fix spelling in useQueue doc and story 2019-11-18 21:47:09 +01:00
Vadim Dalecky
0073acb538
Merge pull request #773 from streamich/fet-improve-useStateValidity
feat: Improve useStateValidator & useMultiStateValidator typings
2019-11-14 22:46:45 +01:00
xobotyi
436c210f7b
feat(useStateValidator): Refactor method and improve typings;
feat(useMultiStateValidator): Refactor method and improve typings;
2019-11-14 14:40:01 +03:00
Daniel
095b4de232 feat: Add useSet hook 2019-11-14 12:26:24 +02:00
xobotyi
399baf6472
Fix formatting issues occurring with newest prettier version; 2019-11-13 02:17:10 +03:00
Brendan
61e29cd249 Proper typing for return value 2019-11-11 20:18:40 +01:00
Brendan
4e1108f392 Proper typing for nextArgs 2019-11-11 20:16:39 +01:00
Brendan
61f21d4400 Remove redundant ref 2019-11-11 20:14:40 +01:00
Vadim Dalecky
61a83d124d
fix: restrict useThrottleFn types 2019-11-11 03:09:55 +01:00
Vadim Dalecky
1b72a53864
Merge pull request #763 from streamich/fix-use-location-in-ie
fix: 🐛 check window.Event constructor exists in useLocation
2019-11-10 20:47:57 +01:00
Yingtao Su
e65338372a feat(useCounter): reset to the newest initialValue (#667) 2019-11-10 20:05:34 +01:00
streamich
ad09431145 fix: 🐛 check window.Event constructor exists in useLocation
IE does not have window.Event constructor.
2019-11-10 20:03:41 +01:00
Anton Zinovyev
8de2a3ee13 chore: move tests to top level /tests folder
chore: move all the tests to the separate directory outside of sources;

chore: remove jest.config.js (config moved to the package.json);

test: unused import in test;

test: 💍 fix tests add back x and y to useMeasure

chore: 🤖 add linter to /tests folder

ci: 🎡 limit Jest worker count for CircleCI
2019-11-08 16:55:34 -05:00
Vadim Dalecky
32b9eb8a2f
Merge pull request #753 from streamich/rework-useList
feat(useList): reimplemented useList hook;
2019-11-08 16:00:17 -05:00
xobotyi
43cb6aa612
feat(useStateList): implemented currentIndex, setState, setStateAt methods as requested in #634;
Reworked a bit implementation of `next` and `prev` to make it reuse the `setStateAt` method;
2019-11-07 12:03:34 +03:00
xobotyi
53787c01c5
Merge branch 'feat/enhance_useDebounce' of https://github.com/brickspert/react-use into brickspert-feat/enhance_useDebounce
# Conflicts:
                    #	src/__tests__/useTimeoutFn.test.ts
                    #	src/useDebounce.ts
2019-11-07 00:40:41 +03:00
Anton Zinovyev
1fdc9076dc
Merge pull request #673 from streamich/useVibrate
useVibrate
2019-11-06 23:57:54 +03:00
Anton Zinovyev
ecaa6a91c8
Merge branch 'master' into feature/use-queue 2019-11-06 23:04:51 +03:00
xobotyi
5a49f844b9
Final fix of #749 2019-11-06 22:54:18 +03:00
Anton Zinovyev
2081b184d0
Merge pull request #754 from streamich/fix-749
fix(#749): now should work with SSR
2019-11-06 16:01:33 +03:00
xobotyi
c12976cad2 fix(#749): now should work with SSR 2019-11-06 15:15:50 +03:00
xobotyi
59aa41cff4 fix(resolveHookState): by accident removed needed type. 2019-11-06 15:09:07 +03:00
xobotyi
1840b577e2 feat(useList): reimplemented useList hook;
feat(useList): new action upsert;
feat(useList): new action update;
feat(useList): new action updateFirst;
feat(useList): new action insertAt;
feat(useList): action remove renamed to removeAt (ref remained);
feat(useUpsert): useUpsert hook deprecated cause of duplicate functionality and bad naming;
2019-11-06 14:49:33 +03:00
Vadim Dalecky
7154ca8d71
Merge pull request #595 from macinjoke/useEvent-type-inference
improve useEvent type
2019-11-05 23:21:13 -05:00
Anton Zinovyev
588f2de637
Merge pull request #738 from streamich/fix-useStateList
fix(useStateList): rework the hook
2019-11-04 12:15:17 +03:00