-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
react-hooks/packages/request/src/index.ts
Lines 163 to 166 in 8d89a72
| const resultFixedForEffect: RequestResult<O, E> = { | |
| ...result, | |
| pending: result.pendingCount === undefined ? true : result.pending, | |
| }; |
Expacted:
const resultFixedForEffect = {
...result,
pending: result.pendingCount === undefined ? true : result.pending,
+ request,
};
So that I can trigger request automatically as well as manually.
const {pending, data: tasks, request: reload} = useRequest(getTasks, {status});
return <>
<button onClick={reload}>Refresh</button>
<List loading={pending} items={tasks} />
</>;
Metadata
Metadata
Assignees
Labels
No labels