new PageStateManager()
Methods
-
clear()
-
Clears the state history.
-
getAllStates()
-
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.
Returns:
The recorded history of page states.
- Type
- Array.<Object.<string, *>>
-
getState()
-
Returns the current page state.
Returns:
The current page state.
- Type
- Object.<string, *>
-
setState(statePatch)
-
Sets a new page state by applying the provided patch to the current state.
Parameters:
Name Type Description statePatch
Object.<string, *> The patch of the current state.