a simple but full-featured web player for OpenSubsonic music servers (Navidrome, Gonic, Ampache, etc) devins.page/tinysub

feat: implement basic 2-stack undo-redo #174

Merged oppi.li
targeting main
Merged opened by and assigned to oppi.li
targeting main

this is quite basic, uses a snapshot style history instead of a command-style storage, where we could store forward/reverse callbacks.

as a result, this can presently only be used for storing and loading full snapshots. you cannot undo favourites/ratings with this model.

to improve this, i would probably update this down the line to make each item of the undostack store a:

{forwardOp, reverseOp}

and the queue snapshotting logic can be augmented to simply be:

{() => {return newState;}, () => {return oldState;}}

Signed-off-by: oppiliappan me@oppi.li

This pull request has no versions submitted yet.