Skip to content

What's the usage for history-merge tag? #3520

Answered by fantactuka
strdr4605 asked this question in Q&A
Discussion options

You must be logged in to vote

The initial idea behind history-merge was to flag HistoryPlugin that current update can be merged with the previous history entry vs creating separate entry in history undo-redo stack. Here's an example:

  • Initializing editor should use history-merge so that initial state wouldn't create new entry in undo-redo stack (otherwise you'd be able to undo initial state and end up with empty editor)
  • Having decorator node where its decorate output mutates node data after insertion (e.g., imagine inserting ImageNode, where its react component updates width and height values in node right after insertion).

In other words, updates marked with history-merge are non-undoable. In comparison to history-push

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fantactuka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants