Manager of the current page state and state history.
• new PageStateManager()
Optional onChange: (
Starts queueing state patches off the main state. While the transaction
is active every
setState call has no effect on the current state.
Note that call to
getState after the transaction has begun will
return state as it was before the transaction.
Cancels ongoing transaction. Uncommitted state changes are lost.
Clears the state history.
Applies queued state patches to the main state. All patches are squashed
and applied with one
Returns the recorded history of page states. The states will be chronologically sorted from the oldest to the newest.
Note that the implementation may limit the size of the recorded history, therefore the complete history may not be available.
The recorded history of page states.
Returns the current page state.
The current page state.
Returns queueing state patches off the main state from the begin of transaction.
State patches from the begin of transaction.
Sets a new page state by applying the provided patch to the current state.
|The patch of the current state.|