Skip to content

Commit

Permalink
[Doc] Fix dataProvider hooks incorrectly document error state as load…
Browse files Browse the repository at this point in the history
…ed=true instead of false

Closes #6233
  • Loading branch information
fzaninotto committed May 6, 2021
1 parent 512fd49 commit 899a579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ This object updates according to the request state:

- start: `{ loading: true, loaded: false }`
- success: `{ data: [data from response], total: [total from response], loading: false, loaded: true }`
- error: `{ error: [error from response], loading: false, loaded: true }`
- error: `{ error: [error from response], loading: false, loaded: false }`

As a reminder, here are the read query types handled by Data Providers:

Expand Down Expand Up @@ -228,7 +228,7 @@ This object updates according to the request state:
- mount: `{ loading: false, loaded: false }`
- mutate called: `{ loading: true, loaded: false }`
- success: `{ data: [data from response], total: [total from response], loading: false, loaded: true }`
- error: `{ error: [error from response], loading: false, loaded: true }`
- error: `{ error: [error from response], loading: false, loaded: false }`

You can destructure the return value of the `useMutation` hook as `[mutate, { data, total, error, loading, loaded }]`.

Expand Down

0 comments on commit 899a579

Please sign in to comment.