Methods
addStateListener(consumer)
Register a listener function. Listeners will be called every time the state changes.
Parameters:
Name | Type | Description |
---|---|---|
consumer |
function | The consumer function. |
- Source:
getState() → {object}
- Source:
Returns:
Current state
- Type
- object
hasStashedState() → {boolean}
To check if we have a state in stash.
- Source:
Returns:
True, if we have state in stash.
- Type
- boolean
setState(state)
Parameters:
Name | Type | Description |
---|---|---|
state |
Object | A new state replacing the previous one. |
- Source:
stashCurrentState()
Stashes current state so it can be returned to later on.
- Source:
updateState(props)
Parameters:
Name | Type | Description |
---|---|---|
props |
Object | Extends and overrides keys in state. |
- Source:
useStashedState()
Retain previously stashed state. Clears the stash.
- Source: