Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FE list: optimistic updates #89967

Closed
TimBroddin opened this issue Apr 26, 2024 · 1 comment
Closed

FE list: optimistic updates #89967

TimBroddin opened this issue Apr 26, 2024 · 1 comment
Assignees

Comments

@TimBroddin
Copy link
Contributor

TimBroddin commented Apr 26, 2024

❗Needs this merged first: #89902

Implement optimistic updates for batch methods inside client/data/plugins/use-update-schedules-mutation.ts

There's two places where we can update the queryClient cache:

  • onMutate: here we can set the data to what we expect it to be
  • onSettled: here we have the return data from each call as an array containing { siteSlug, response, error }. We can remove the errored entries here. Afterwards we invalidate multisite-schedules-update, which should then update to the same value we just set (if we nail it).
@TimBroddin
Copy link
Contributor Author

Maybe the onMutate one isn't needed, as we don't redirect to the list until creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant