146 Commits

Author SHA1 Message Date
Ward Oosterlijnck
2b3dd239cb Make useHoverDirty controllable + reuse in useMouse 2019-03-26 11:20:42 +01:00
Ward Oosterlijnck
28b5bc97d4 useMouse whenHovered option 2019-03-26 11:20:42 +01:00
ShizukuIchi
b88707554f feat: more precise size for useMouse 2019-03-26 11:20:42 +01:00
Ward Oosterlijnck
8bf149794b useScroll cancel animation frame in handler 2019-03-26 11:20:42 +01:00
Ward Oosterlijnck
2fd1d673e0 remove event listener + cancel animation frame in handler 2019-03-26 11:20:42 +01:00
Ward Oosterlijnck
e8b43ea95c useMouse hook 2019-03-26 11:20:42 +01:00
streamich
5dd10e91ee feat: 🎸 keep global state of all useLockBodyScroll hooks
This change will keep document body locked as long as at least one hook
is enabled on the page. Maybe it makes sense to generalize this logic
for other side-effect hooks. One such hook could be useBlurBody that
blurs page - useful for modals and overlays.
2019-03-26 11:20:42 +01:00
Ward Oosterlijnck
5740a53f35 useLockBodyScroll 2019-03-26 11:20:42 +01:00
streamich
a03143a46f feat: 🎸 implement useClickAway, remove useOutsideClick
This re-implements outside click hook functionality from scratch,
removes dependency on use-onoutsideclick package.

BREAKING CHANGE: 🧨 useOutsideClick is now useClickAway
2019-03-25 13:52:52 +01:00
streamich
428876ab34 chore: 🤖 move useCss hook under UI section
Also remove remainders of useCallbag hook.
2019-03-25 13:23:49 +01:00
streamich
61700675cd chore: 🤖 don't install only large dependencies
This change removes useCallbag hook, it also reverts back changes for
hooks that only have tiny dependencies or dependencies that could have
been part of the hook itself. Effectivly only KeyboardJS and Rebound are
large packages that only partially are used by react-use, hence require
user to install them separately.

BREAKING CHANGE: 🧨 useCallbag hook is removed, some hooks KeyboardJS and Rebound installed
separately
2019-03-25 13:19:37 +01:00
Va Da
a92e9b203f
feat: add useScroll hook 2019-03-23 11:24:29 +01:00
Ward Oosterlijnck
584bd7e618 cancel animation frame on un-mount 2019-03-23 20:00:43 +11:00
Ward Oosterlijnck
71eb416953 useWindowScroll doc typos 2019-03-23 19:56:49 +11:00
Ward Oosterlijnck
c75f997f8e useScroll hook 2019-03-23 19:48:38 +11:00
streamich
bc021ce550 fix: 🐛 cancel animation frame on un-mount in useWindowScroll() 2019-03-23 08:40:31 +01:00
Ward Oosterlijnck
874e9a9ba5 useWindowScroll hook 2019-03-23 16:46:04 +11:00
streamich
0116cc9fed feat: 🎸 refresh useCss hook 2019-03-22 20:51:06 +01:00
Luis Felipe Zaguini
26953f12cf
Create useUpdateEffect.story.tsx 2019-03-21 10:20:36 -03:00
Luis Felipe Zaguini
d7f9ee4cb3
Update index.ts 2019-03-21 10:14:31 -03:00
Luis Felipe Zaguini
27e4444dd3
Create useUpdateEffect.ts 2019-03-21 10:07:41 -03:00
Va Da
576cf42e3f
feat: add useAsyncRetry hook 2019-03-21 10:16:25 +01:00
Va Da
8e3de1cdf1
perf: remove asyn/await wrapper 2019-03-21 10:15:27 +01:00
streamich
7328f26310 fix: 🐛 use useLayoutEffect() in useCss() to inject CSS quick 2019-03-20 18:35:24 +01:00
lvl99
46d0c2766b correct incorrect logic 2019-03-20 17:06:36 +01:00
lvl99
7ceff990aa added console message to notify user about useAsyncRetry operation still loading 2019-03-20 15:44:55 +01:00
lvl99
8b7d5ed3ac reverted useAsync and created new hook useAsyncRetry which leverages useAsync
added story and docs for useAsyncRetry
fixed up new code formatting to match project
2019-03-20 15:12:45 +01:00
Va Da
d1aebe0a90
Merge branch 'master' into pr/139 2019-03-19 22:50:02 +01:00
streamich
7cf90107e1 chore: 🤖 various improvements for useKeyPrssEvent()
add link to README, expose in index.ts, improve docs/demo, add Storybook
story
2019-03-19 22:47:12 +01:00
lvl99
2d02612628 first pass at retry/refresh ability for useAsync 2019-03-16 14:29:58 +01:00
streamich
d60fef7db3 fix: 🐛 allow every promise in usePromise() hook have own type 2019-03-15 15:43:55 +01:00
streamich
ba0acb66f2 fix: 🐛 fix TypeScript typings for usePromise() 2019-03-15 15:24:39 +01:00
streamich
aad368ba67 feat: 🎸 add usePromise() hook 2019-03-15 15:14:00 +01:00
streamich
a2a6fe326a chore: 🤖 split display secions in Storybook left column 2019-03-15 14:46:00 +01:00
Parker McMullin
c3d49e230b Added useKeyPressEvent custom hook with associated doc. This focuses on utilizing the onKeyup and/or onKeydown events unlike useKeyPress which involves state. useKeyPressEvent uses useKeyPress to achieve this functionality. 2019-03-09 19:25:59 -07:00
chengruilin
9c8e093155 fix: correct createMemo.story 2019-03-08 11:15:32 +08:00
streamich
8f938538d3 fix: 🐛 make useWindowSize work on server 2019-03-04 17:41:44 +01:00
Timothy Vernon
2ba0c4b92d
Fix typo in comments 2019-03-01 10:10:13 +01:00
streamich
e926faf909 fix: 🐛 new React behaviour needs useState to set something
Issues: closes #128
2019-02-25 12:13:23 +01:00
Va Da
ea2dc432a5
fix: add type definition for useList() remove() method 2019-02-23 15:27:46 +01:00
landong.lk
83611a11f9 fix: useSetState bug 2019-02-22 16:09:16 +08:00
Evan Sharp
5a295d9b46
feat: Add remove method for useList 2019-02-21 14:06:37 -05:00
streamich
2096bae65b fix: 🐛 better async loading for keyboardjs
closes #103
2019-02-19 17:18:10 +01:00
Mohamed Magdy
dcadfef74c add error state to useGeolocation state 2019-02-19 11:50:04 +02:00
streamich
524abe5702 fix: 🐛 fix useSetState after React update
As reported in #107

Issues: #107
2019-02-17 09:19:40 +01:00
streamich
afbacace24 fix: 🐛 fix typings in useOrientation sensor 2019-02-17 09:14:25 +01:00
ShizukuIchi
77ebef5433 fix useOrientation bug 2019-02-11 12:40:44 +08:00
Va Da
ad056092a3
feat: Add updateAt method for useList 2019-02-07 12:57:04 +01:00
streamich
27e26a0135 fix: 🐛 fix build and update React deps 2019-02-07 12:51:53 +01:00
Alon Niv
5c72b7c720
Add updateAt method for useList 2019-02-07 09:54:11 +02:00