Subscribe to state changes of the dashboard.
subscribeToStateChanges(callback: DashboardStateChangeCallback): IDashboardEventHandling;
|function to call when dashboard state changes; the function will be called with two parameters: the new state and an instance of dispatch to use.
self, for call chaining sakes
There is no need to use this if all you need is your custom React components to get up-to-date state. Your React component code can (and really should) use the useDashboardSelector and useDashboardDispatch hooks instead.
Subscription to state changes is only really needed if you have custom code outside of React components and you need to extract custom data from state using the selectors API.