Skip to content

v0.1.0-beta.22

Compare
Choose a tag to compare
@timc1 timc1 released this 25 Nov 19:26
· 78 commits to main since this release
e9bd63f

Undo/Redo

Introducing the ability to easily add undo & redo functionality to actions!

  • Create the undo (negate) action by returning a function from perform:
    createAction({
      perform: () => {
        // logic to perform
        return () => {
          // logic to undo
        }
      }
    })
  • Perform actions using action.command.perform
  • Explicitly undo actions using action.command.undo, redo using action.command.redo

demo

Fixes

  • Deprecated the usage of useDeepMatches in favor of just useMatches. #124
  • Reworked a few internal types; e.g. BaseAction renamed to Action