You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was thinking of adding an optimistic feature to the persist middleware, in general, what I wish for is that for any async persist the middleware will clone the current state into oldState, change the UI, and then make the appropriate call to the async storage(backend/indexedDb, etc..) with a .catch(error=>...) that does a rollback to the by set(oldState)
In the options we can add an onError callback that will be called when reverting back, so users can pop a toast/log it, etc..
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I was thinking of adding an optimistic feature to the persist middleware, in general, what I wish for is that for any async persist the middleware will clone the current state into
oldState
, change the UI, and then make the appropriate call to the async storage(backend/indexedDb, etc..) with a.catch(error=>...)
that does a rollback to the byset(oldState)
In the options we can add an
onError
callback that will be called when reverting back, so users can pop a toast/log it, etc..What you guys think?
Beta Was this translation helpful? Give feedback.
All reactions