I'm trying to breakdown the coding in a widget.tsx file so I can customize to meet my own needs. In the sample "control-the-widget-state" the first line in the widget.tsx file is this:
Solved! Go to Solution.
Honestly, inadequate documentation, especially on the developer side, is one of the biggest problems holding Experience Builder back. I have learned far more by reading through other people's code than I have the official documentation.
As for the appActions, it is an object with a number of methods for sending data between widgets. For example, this line of code can be used to close a Sidebar Widget.
getAppStore().dispatch(appActions.widgetStatePropChange(`widget_${sidebarId}`, 'collapse', false))
Honestly, inadequate documentation, especially on the developer side, is one of the biggest problems holding Experience Builder back. I have learned far more by reading through other people's code than I have the official documentation.
As for the appActions, it is an object with a number of methods for sending data between widgets. For example, this line of code can be used to close a Sidebar Widget.
getAppStore().dispatch(appActions.widgetStatePropChange(`widget_${sidebarId}`, 'collapse', false))
@JeffreyThompson2 is right, the documentation at times is not just sparse and limit, but silent on many of these tasks.
I find it sometimes useful to go in with an IDE like Visual Studio (Community or Code), or WebStorm create the code, and than use the tools in them to trace the references down.
That allows me to look at the code file it originates in, so that I can have some idea what its doing.
SO appActions traces to a app-actions.d.ts file under /client/jimu-core/lib/app-acftions.d.ts
However, I'll admit its not obvious if you search that file for appActions that what you are getting is not a 'class' but a module which contains a bunch of 'functions', so in a way the appActions name kind of acts like a namespace? for that file which defines that type.