Every operation that modifies any packets (create, delete, change) should go on a state stack. Literally push a new item onto .packets and have a currentPacketVersion which stays at 0 when it's at head, and is non-zero when it's not.
Pass into packet-editor canUndo and canRedo.
[ ] Make state.data.versionedPackets be an object with a packets array, and have getPacket know how to handle it
[ ] Add a state.data.versionedPacket.currentVersion= 0
[ ] Add a pushVersion(versionedState, newVersion : packet)
[ ] When doing an action that modifies packets, use pushVersion
Related to #6.
Some way to support undo/redo in the app.
Every operation that modifies any packets (create, delete, change) should go on a state stack. Literally push a new item onto
.packets
and have a currentPacketVersion which stays at 0 when it's at head, and is non-zero when it's not.Pass into packet-editor
canUndo
andcanRedo
.state.data.versionedPackets
be an object with apackets
array, and havegetPacket
know how to handle itstate.data.versionedPacket.currentVersion
= 0