Hi all, I was just wondering if anyone knew any method on the public API to generate a snapshot from a model?
The use-case I had in mind was generating id’s for models client-side, and enqueueing any saves which should be done, and processing this queue in the background. This process would pause temporarily in the event of the server not being available (allowing the user to continue working offline for the most part), or an error occurring when saving the current entity being processed.
The reason I would need the snapshot is in the event of the same entity being saved multiple times at different points in time before the queue gets processed. Because other models could depend on the changes from that entity, I would need to rollback the store state to that point in time (replacing / removing all current instances of entities in the store up until that specific operation), and run the save logic from that point forward and deal with errors as i get to them.
I could also store these snapshots in local-storage in case of the browser closing etc…
Anyone have any thoughts on this? I suppose what I could do for now if no-one has a better way of doing this I could reopen
DS.Snapshot and add a public method for creating one.