3 ms·
There are transactions! https://tinybase.org/api/store/interfaces/store/store/methods/setter/transaction/ https://tinybase.org/api/store/interfaces/store/store/
by jamesgpearce 5y ago
There are transactions! https://tinybase.org/api/store/interfaces/store/store/methods/setter/transaction/ https://tinybase.org/api/store/interfaces/store/store/method...
This allows you to wrap a batch of mutations together and then the fully reconciled change events are all fired together at the end. Apparently I could do a better job of marketing this secret feature :)
As another commenter has mentioned, there are also 'checkpoints' that let you create a stack of points in history to undo/redo back and forwards through. https://tinybase.org/guides/relationships-and-checkpoints/using-checkpoints/ https://tinybase.org/guides/relationships-and-checkpoints/us...
- pygy_ 5y agoAwesome! Do you support locks/rollback or conflict detection? If not is it planned?
- jamesgpearce 5y agoAh no, these aren't transactions in the sense of locking and multiple client access. My glib answer is that there's perk to JavaScript not being multithreaded! But seriously, when persisting/saving a Store, the library doesn't guarantee that you aren't saving over something another browser window might have just written. I would need to think about what that would entail.
- deleted 5y ago[deleted]