You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a placeholder issue for me to do some thinking about the relationship between History and Domains.
Right now domains already maintain a ledger of state revisions for outstanding actions. There is duplication between the history, it's underlying tree data structure, and this ledger. This isn't a functional issue, more of bad feel.
Instead, each domain could manage their own history. This would also let you do some pretty neat stuff:
Domains could undo/redo without affecting other "histories"
Should domains manage their own history?
Patch/Reset
This also allows an optimization for patch/reset: If a domain's state is patched, the state of all prior actions will always be overridden. There is no reason to process them. Unfortunately we can't do anything about this until Domains manage their own history (assuming this is a good idea)
A user logs out
There is another use case: What happens when a user logs out? In this case, you don't want to hold on to any information about the prior user, however this distinction might be split across several domains. It would be valuable to be able to "lose" revision history for a specific domain.
Domains in web workers
Additionally, if each domain has its own history, there's nothing tying them to the main thread. You could easily run a domain inside of a web-worker.
The text was updated successfully, but these errors were encountered:
This is a placeholder issue for me to do some thinking about the relationship between History and Domains.
Right now domains already maintain a ledger of state revisions for outstanding actions. There is duplication between the history, it's underlying tree data structure, and this ledger. This isn't a functional issue, more of bad feel.
Instead, each domain could manage their own history. This would also let you do some pretty neat stuff:
Patch/Reset
This also allows an optimization for patch/reset: If a domain's state is patched, the state of all prior actions will always be overridden. There is no reason to process them. Unfortunately we can't do anything about this until Domains manage their own history (assuming this is a good idea)
A user logs out
There is another use case: What happens when a user logs out? In this case, you don't want to hold on to any information about the prior user, however this distinction might be split across several domains. It would be valuable to be able to "lose" revision history for a specific domain.
Domains in web workers
Additionally, if each domain has its own history, there's nothing tying them to the main thread. You could easily run a domain inside of a web-worker.
The text was updated successfully, but these errors were encountered: