Skip to content

How to combine entities's history? #384

Answered by EricPoul
toadfanszz asked this question in Q&A
Discussion options

You must be logged in to vote

@clszzyh

  1. since you have two entity state histories you need to undo both of them independently:
sheetsStateHistory.undo("sheet1");
rowsStateHistory.undo("row1");
  1. There's no way to do such a thing by entityStateHistory. But I guess you can do next:
sheetsStore.update(
  updateEntities('row1', {data: 'second'}),
)

const sheetRows = sheetStore.query(getEntity("sheet1")).rowIds;

if (sheetRows.includes("row1")) {
  rowsStateHistory.undo("row1");
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

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