AriaFallah / mobx-store

A data store with declarative querying, observable state, and easy undo/redo.
MIT License
282 stars 9 forks source link

Can i use redo on anything more than a store property ? #53

Closed MocanuMarius closed 7 years ago

MocanuMarius commented 7 years ago

So in your expmples you use store.unde('mykey'), where you previously stored that key as something. The aspect i'm interested in is that.. let's say i remotely and locally , at the same time , add an item to my collection of Todo's. ( Via AJAX + store.add ) as an optimistc network approach.

For some reason the network requests fails, and i want to undo the store adding operation. Is that possible in any form at this moment ? I understand that there would be a lot of concurrency problems like "what if some other part of the app modifies that store" , but i guess that could be implemented with some internal id's of those items in the store. Is this possible atm/do you have this in mind for the future ?

Or do you have in mind any other system that would allow a seamless experience with just using actions/reactions on failiures ? ( i cannot think of any other where this is a lower-level apprach and that could stick togheter)

Thanks ! :)

AriaFallah commented 7 years ago

Yes it's possible, but unfortunately I'm not working on this project anymore. I would suggest looking to this project made by the MobX creator, which is far superior to this little experiment of mine.

https://github.com/mobxjs/mobx-state-tree

MocanuMarius commented 7 years ago

Alright, thanks a lot :)