the object to create the state from.
The private state to be used internally by Router.
The public state for clients to access. Only serializable types (e.g. Numbers and Strings) are supported.
Returns true if the given object is a valid state object. Uses the {@link State#isValid} method under the hood.
the object to validate
A factory method that creates a new state object with the given private state. It is used by Router to create a new state object when a new path is entered or when the popstate event is fired.
the private state to be stored in the state object.
Returns true if the given object is a valid state object.
the object to validate
Generated using TypeDoc
A convenience type creating the state object to be stored in history.state. Contains a {@link State#publicState} field where the public state is stored, And a field where Router's private state is stored, which can be accessed using the {@link ROUTER_PRIVATE_STATE_KEY} constant.
This goes without saying, the private state is not meant to be tampered with.