330 Commits

Author SHA1 Message Date
whincwu
44a6cde00e feat: add useHash hook 2020-04-08 09:21:06 +03:00
xobotyi
baa2f7511e
feat(useRafLoop): reworked the hook, now it do not re-render parent component.
BREAKING CHANGE: changed return array, now it returns only functions in next order: [stop, start, isActive].

Parent component is not re-rendered on loop start/stop.
2020-04-01 10:43:31 +03:00
xobotyi
1ef1272d6d
feat(useRafLoop): implement #1090 2020-04-01 08:49:05 +03:00
Octave Raimbault
477614f9ef
feat(useSet): add toggle a method (#968)
Co-authored-by: Ward <wardoosterlijnck@gmail.com>
2020-03-03 14:00:40 +11:00
Justin Conner
d4489d0644 Renames Animation.md file to Animations.md 2020-02-29 04:33:54 +03:00
Mikael Finstad
f049d9151e
Fix typos and doc error 2020-02-20 17:53:00 +08:00
LittleboyHarry
4464832875
Update useCounter.md
Fixed error parameter name.
2020-02-16 10:31:02 +08:00
Vadim Dalecky
a2c26a2b68
Merge pull request #910 from ayush987goyal/pr/use-methods
feat: add useMethods state hook
2020-02-15 15:25:05 +01:00
Ayush Goyal
7554b9a61e feat: add useMethods state hook 2020-02-15 19:24:48 +05:30
Vadim Dalecky
290c87313a
Merge pull request #750 from mvargeson/fix-lifecycle-hooks-broken-href
docs: rename docs/Lifecycle.md to match README.md
2020-02-15 14:48:00 +01:00
Vadim Dalecky
5ea486edf1
Merge pull request #867 from bebbi/feat/before-unload-callback
feat(useBeforeUnload): allow passing a dirty function (#842)
2020-02-15 14:10:30 +01:00
streamich
7c93cd1236 chore: 🤖 catch up with master 2020-02-04 01:27:02 +01:00
Vadim Dalecky
fda7199b7d
feat: add createGlobalState hook generator 2020-02-03 16:20:07 -08:00
Josmar Dias
2005535518
docs: useCustomCompareEffect should import itself (#909) 2020-01-30 14:51:18 +03:00
Guillaume L
f06895d9d5 [FIX] typo in useStateList.md (#923)
`nexct` --> `next`
2020-01-27 17:46:37 +03:00
Kuss
57b904118e fix: Fail testing and update doc 2020-01-24 19:04:39 +08:00
Kuss
a0d61b5ea1 optional parameter and update test 2020-01-24 17:27:58 +08:00
Kuss
45681b88e3 feat: add useLongPress hook 2020-01-23 13:03:45 +08:00
Mateusz Leonowicz
dc07e0e3b9 add setAll instead of overloading reset 2020-01-17 15:56:37 +00:00
Mateusz Leonowicz
7645f7249d feat: useMap: allow resetting with provided value other then initial 2020-01-17 15:03:35 +00:00
Ayush Goyal
65f3644205 feat: add useError hook 2020-01-16 21:13:35 +05:30
Ayush Goyal
5316510bab feat: add serializer/deserializer option to useLocalStorage 2020-01-15 23:14:17 +05:30
MrHuangJser
08d13933e3
Update docs/createGlobalState.md
fix spell issue

Co-Authored-By: Vadim Dalecky <streamich@users.noreply.github.com>
2020-01-14 08:57:59 +08:00
Brendan Daoud
6d61c1d95a
Merge branch 'master' into pr/useStateContext 2020-01-13 18:08:09 +01:00
Brendan
bc74530f35 Add create reducer context 2020-01-13 14:01:21 +01:00
Brendan
e34ee0e66c Allow initial value override 2020-01-13 13:32:24 +01:00
Brendan
7285f7dc7a Add createStateContext 2020-01-13 13:09:29 +01:00
Ayush Goyal
3e806fdc03 Update ts ref in doc 2020-01-13 07:26:33 +05:30
MrHuangJser
ebc7b5b0f5 rename useGlobalState to createGlobalState 2020-01-13 09:42:56 +08:00
Ayush Goyal
bc72bc13e7 Add useCookie hook 2020-01-12 02:00:24 +05:30
Stefan
c4a14a4fb3 feat(useBeforeUnload): allow passing a dirty function (#842) 2020-01-08 13:43:01 +01:00
streamich
1e379e4966 chore: 🤖 catch up with master 2020-01-03 19:38:07 +01:00
Anton Dosov
4f35605423 add useShallowCompareEffect and useCustomCompareEffect 2019-12-27 14:31:52 +03:00
MrHuangJser
c85b85a299 MrHuangJser - add useGlobalState hook 2019-12-26 18:33:29 +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
streamich
28ef34b4c7 docs: ✏️ add useUnmountedPromise reference 2019-12-08 00:54:58 +01:00
Zach Schnackel
15fa1381c2
Typo in useList md 2019-12-03 17:09:06 -05: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
Vinit
1811908bd6 fix spelling in useQueue doc and story 2019-11-18 21:47:09 +01:00
Daniel
095b4de232 feat: Add useSet hook 2019-11-14 12:26:24 +02: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
8538385afb
docs: fix useMeasure return keys 2019-11-08 16:16:50 -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
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
Matthew Vargeson
8b7a9bff16
docs: rename docs/Lifecycle.md to match README.md 2019-11-05 12:34:28 -08:00