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

Support optimisticData as a function #1858

Closed
shuding opened this issue Feb 15, 2022 Discussed in #1850 · 0 comments · Fixed by #1861
Closed

Support optimisticData as a function #1858

shuding opened this issue Feb 15, 2022 Discussed in #1850 · 0 comments · Fixed by #1861
Labels
area: mutation feature request New feature or request

Comments

@shuding
Copy link
Member

shuding commented Feb 15, 2022

Discussed in #1850

Originally posted by ludovic-montel February 9, 2022
First of all, thanks a lot for this library. I've been using it for almost a year, and more intensively for several months, and I love it!

Il like to create optimistic user interfaces, and the new optimisticData option with its auto-rollback behavior is great!

I'd like to push it a little further: could you optimisticData as a function ? I think it would be consistent with the mutate first argument and with #1817.

This function would take the cached data as parameter, and would allow:

  • using the global mutate function
  • extracting and test a pure function that makes the mutation I want, depending on the current data and the operation that is processed

Again, thanks a lot for your work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mutation feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant