You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ without assumptions about the shape of your data or the type of request.
40
40
- Choose between Render Props, Context-based helper components or the `useAsync` hook
41
41
- Provides convenient `isLoading`, `startedAt` and `finishedAt` metadata
42
42
- Provides `cancel` and `reload` actions
43
-
- Automatic re-run using `watch` prop
43
+
- Automatic re-run using `watch`or `watchFn`prop
44
44
- Accepts `onResolve` and `onReject` callbacks
45
45
- Supports [abortable fetch] by providing an AbortController
46
46
- Supports optimistic updates using `setData`
@@ -205,6 +205,7 @@ The shorthand version currently does not support passing additional props.
205
205
-`promiseFn` {(props, controller) => Promise} A function that returns a promise; invoked in `componentDidMount` and `componentDidUpdate`; receives component props (object) and AbortController instance as arguments
206
206
-`deferFn` {(...args, props, controller) => Promise} A function that returns a promise; invoked only by calling `run(...args)`, with arguments being passed through, as well as component props (object) and AbortController as final arguments
207
207
-`watch` {any} Watches this property through `componentDidUpdate` and re-runs the `promiseFn` when the value changes (`oldValue !== newValue`)
208
+
-`watchFn` {(props, prevProps) => any} Re-runs the `promiseFn` when this callback returns truthy (called on every update).
208
209
-`initialValue` {any} initial state for `data` or `error` (if instance of Error); useful for server-side rendering
209
210
-`onResolve` {Function} Callback function invoked when a promise resolves, receives data as argument
210
211
-`onReject` {Function} Callback function invoked when a promise rejects, receives error as argument
0 commit comments