Skip to content

@xstate/store@4.2.2

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Jul 22:53
b1811bf

Patch Changes

  • #5608 fbcbd5a Thanks @davidkpiano! - Allow snapshot-based undo and redo to customize restored context while preserving complete history snapshots. Restoration can enqueue emitted events, effects, and store triggers.

    const undoableStore = store.with(
      undoRedo({
        strategy: 'snapshot',
        restore: ({ current, next }) => ({
          ...next,
          viewport: current.viewport
        })
      })
    );