I am trying to get the current state of an out of the box widget (filter) but not finding a way to get it. I can easily set the state of that widget with: getAppStore().dispatch(appActions.widgetConfigUpgraded("widget_65", config)). But how can I get the current state from "widget_65" (which is inside a sidebar and navigation section if that matters)?
- getAppStore().getState().widgetsRuntimeInfo?.["widget_65"]?.state
- state is never set. The runtime info only has one property for isClassLoaded which is true.
- getAppStore().getState().widgetsState["widget_65"]
- widgetsState does not contain the widget, it only has a list and the sidebar. Neither which seem to expose their state either.
- getAppStore().getState().appConfig.widgets["widget_65"]
- I can get the state from this, but it is not the current state and is the initially loaded one, which makes sense coming from appConfig.
- WidgetManager.getInstance() not seeing any option in it to get the state.
- Can I use getAppStore().subscribe, not seeing how to get the state though.
I feel like I am missing something simple, any advice is greatly appreciated!