View.setState method
View › setState
Official
Set the state of the view.Signature:
setState(state: unknown, result: ViewStateResult): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
| state | unknown | The state. |
| result | ViewStateResult | Set result.history to true to record the state change in the navigation history. |
Since: 0.9.7
Example:
class MyView extends ItemView { public override async setState(state: any, result: ViewStateResult): Promise<void> { this.foo = state.foo; result.history = true; await super.setState(state, result); }}