26 Commits

Author SHA1 Message Date
xobotyi
b6993a6f95
feat(prettier): make prettier a part of eslint.
Also reduce max line width to 100. And remove `lint:types` step for
commit sequence, it bothers when committing incomplete (wip) changes.
2021-02-01 18:58:55 +03:00
Renovate Bot
a27f09fd36
chore: refactoring and rearrangement.
More DRY code. Also move non-hooks to separate directories.

BREAKING CHANGE: all `create*` factories been moved to `factory` subdirectory and in case direct import should be imported like `react-use/esm/factory/createBreakpoint`
BREAKING CHANGE: `comps` directory renamed to `component`
2021-01-30 23:30:26 +03:00
xobotyi
563f71db14 Fix Promise type detection;
Fix function name;
2019-09-04 14:03:26 +03:00
xobotyi
641a879a51 useAsyncFn and useAsync typings made great again =)
Now it uses fully generic arguments and returning types, thus no problems with inferring callback call arguments;
2019-09-04 11:29:26 +03:00
NullVoxPopuli
ed17aed4bd make types better 2019-05-31 13:04:25 -04:00
NullVoxPopuli
facedc10aa simplify types 2019-05-30 13:41:12 -04:00
NullVoxPopuli
4f8b1b9897 wrong default. whoops 2019-05-29 14:59:00 -04:00
NullVoxPopuli
30209518d5 finished 2019-05-29 14:11:42 -04:00
NullVoxPopuli
cabb9d6676 tests pass, now to fix types 2019-05-29 13:04:11 -04:00
NullVoxPopuli
3f9cc47975 add some tests 2019-05-29 10:08:12 -04:00
NullVoxPopuli
ab418cc6ec add tests, and fix the initial state issue 2019-05-28 17:30:59 -04:00
Ankith Konda
f02b92d423 Add TSLint + Prettier and fix lint issues 2019-04-12 23:18:11 +10:00
Ward Oosterlijnck
914fccfffc Rename useAsyncCallback to useAsyncFn 2019-04-09 08:48:14 +10:00
Ward Oosterlijnck
4b998d6e08 reuse useAsyncCallback in useAsync 2019-04-09 00:36:57 +10:00
Ward Oosterlijnck
2c49244537 Default dependency array for useAsync and useAsyncRetry 2019-03-31 13:03:14 +11:00
ZHAO Jinxiang
b0c97709bf fix: add optional attributes in AsyncState 2019-03-29 15:10:12 +08:00
ZHAO Jinxiang
929e72679b fix: fix deps arg and union type in useAsync and useAsyncRetry 2019-03-28 22:32:35 +08: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
lvl99
2d02612628 first pass at retry/refresh ability for useAsync 2019-03-16 14:29:58 +01:00
hahabazinga
2f5af2ca66 fix: reset state when calling useEffect in useAsync 2018-12-29 16:26:15 +01:00
streamich
244a533d33 fix: 🐛 memoized does not receive arguments 2018-12-19 23:04:18 +01:00
James Ivings
88dd513624 feat: pass arguments to memoized callback (#81) 2018-12-19 17:07:26 +01:00
streamich
7c1b107eb4 feat: 🎸 list all useAsync state props so that TS dont complain 2018-12-17 18:37:14 +01:00
ZHAO Jinxiang
966af4aaee feat: use discriminated union in useAsync 2018-12-17 21:12:38 +08:00
streamich
cdc5ec596d refactor: 💡 use import hooks from React proper 2018-12-16 11:02:52 +01:00
streamich
258d696438 feat: 🎸 add useAsync hook 2018-10-27 22:40:50 +02:00