Context returned in onMutate
is not available in onError
hook (and onMutate
has no errors)
#95
Labels
🐞 bug
this isn't working as expected
I am implementing a basic optimistic to-do inspired by @posva's PR on Atidone. But I have an issue where the context I return in
onMutate
is not being available inonError
. And I am certainonMutate
is not erroring.Reproduction: https://github.com/ymansurozer/optimistic/blob/main/pages/basic.vue
Reproduction code (quite simple so I am adding it here too):
And the logs:
P.S.: I am working on a generic
useOptimisticList
composable to simplify optimistic updates for all CRUD operations for a basic list. The composable is here and a sample usage is here.basic.vue
is a stripped version to show the bug. I was hoping we could include the composable in the cookbooks in the docs, if you're open to it @posva. Happy to create a PR. ❤️The text was updated successfully, but these errors were encountered: