Skip to content

Conversation

davidkpiano
Copy link
Member

Add skipEvents option to undoRedo() to exclude certain events from undo/redo history.

const store = createStore(
  undoRedo(
    {
      context: { count: 0 },
      on: {
        inc: (ctx) => ({ count: ctx.count + 1 }),
        log: (ctx) => ctx // No state change
      }
    },
    {
      skipEvents: (event) => event.type === 'log'
    }
  )
);

Copy link

changeset-bot bot commented Oct 13, 2025

🦋 Changeset detected

Latest commit: 31db20d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@xstate/store Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@davidkpiano davidkpiano requested a review from Andarist October 13, 2025 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant