Commit ada8969
authored
React Async v4 (#21)
This is a major update making `useAsync` the primary interface, stabilizing its API. It also adds the `useFetch` hook for more convenience working with HTTP requests. Furthermore there's several breaking changes:
- `deferFn` now receives an `args` array as the first argument, instead of arguments to `run` being spread at the front of the arguments list. This enables better interop with TypeScript. You can use destructuring to keep using your existing variables.
- The shorthand version of `useAsync` now takes the `options` object as optional second argument. This used to be `initialValue`, but was undocumented and inflexible.1 parent 8719518 commit ada8969
File tree
10 files changed
+511
-249
lines changed- examples/with-abortcontroller/src
- src
- typings
10 files changed
+511
-249
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
0 commit comments