observeState( )


Defines a callback function that receives changes to the state of a dashboard page's environment.

This function can only be used in page code files for dashboard pages created in the Wix Editor or with Wix Blocks.

Use the data passed to observeState()'s callback function to dynamically update a dashboard page's content.

The callback function passed to observeState() is triggered when the dashboard page is initialized and every time it's updated.

Method Declaration
Copy
Method Parameters
observerfunctionRequired

observer(pageParams: object, environmentState: EnvironmentState): void Callback function for receiving state data.

Was this helpful?
Yes
No