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
I'm building a offline-first React Native app using redux-offline. Right now I'm trying to find the best way to provide undo functionality (if there's a good way to do this already please let me know). What I'm suggesting is something like this:
A configurable delay before the first request is fired when online (let's say 10 seconds).
Expose an undo action creator that (a) triggers an action for the redux-offline reducer to remove the most recent item in the outbox and (b) triggers the rollback action with the associated metadata of that item.
Expose a selector that indicates whether an undo is possible (i.e. there's at least one item in the outbox that has not yet triggered a request to the server).
The text was updated successfully, but these errors were encountered:
@wacii Could you give an idea on how to achieve this functionality at least? If I could just trigger an action that removed the last added item from the outbox I'd be happy. The rest I could take care of easily.
There is no action for that, you would have to add one yourself. By default, the offline actions are stored in an array at state.offline.outbox. If you wanted to remove the latest offline action, just get rid of the last item in that array.
I'm building a offline-first React Native app using redux-offline. Right now I'm trying to find the best way to provide undo functionality (if there's a good way to do this already please let me know). What I'm suggesting is something like this:
The text was updated successfully, but these errors were encountered: