<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic State Managment in Exp Builder in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/state-managment-in-exp-builder/m-p/1603214#M18304</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;in a Custom Widget, I want to use the reduxStore to hold some features, such that I can access them in every component without having to prop drill. With simple values like strings, this works marvelous. How ever if I try it with an esri.Graphic Object, i get an immutable object back, which has different properties. What is the correct way to store such values in the redux store?&amp;nbsp; Thanks&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;useEffect(() =&amp;gt; {
if (!appStore.getState().widgetsState?.[id]?.steps) {
     appStore.dispatch(appActions.widgetStatePropChange(id, 'steps', Search));}}, [id]);
//and retrieving:
const steps = appStore.getState().widgetsState?.[id]?.steps;
//this works as expected.

//However
queryFeatureLayer(query).then((feat: Graphic) =&amp;gt; {
appStore.dispatch(appActions.widgetStatePropChange(widgetId, '_lineFeature', feat));
}
appStore.getState().widgetsState["widget_3"]._lineFeature yiels

Object { … }
__immutable_invariants_hold: true
asMutable: function B(e)​
getIn: function F(e, t)​
merge: function A(e, t)​
replace: function P(e, t)​
set: function N(e, t, r)​
setIn: function L(e, t, r)​
update: function M(e, t)​
updateIn: function U(e, t)​
without: function E(e)
&amp;lt;prototype&amp;gt;: Object { … }
// which has no similaritys to  a __esri.Graphic Object&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 07 Apr 2025 10:20:51 GMT</pubDate>
    <dc:creator>Baral_lec</dc:creator>
    <dc:date>2025-04-07T10:20:51Z</dc:date>
    <item>
      <title>State Managment in Exp Builder</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/state-managment-in-exp-builder/m-p/1603214#M18304</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;in a Custom Widget, I want to use the reduxStore to hold some features, such that I can access them in every component without having to prop drill. With simple values like strings, this works marvelous. How ever if I try it with an esri.Graphic Object, i get an immutable object back, which has different properties. What is the correct way to store such values in the redux store?&amp;nbsp; Thanks&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;useEffect(() =&amp;gt; {
if (!appStore.getState().widgetsState?.[id]?.steps) {
     appStore.dispatch(appActions.widgetStatePropChange(id, 'steps', Search));}}, [id]);
//and retrieving:
const steps = appStore.getState().widgetsState?.[id]?.steps;
//this works as expected.

//However
queryFeatureLayer(query).then((feat: Graphic) =&amp;gt; {
appStore.dispatch(appActions.widgetStatePropChange(widgetId, '_lineFeature', feat));
}
appStore.getState().widgetsState["widget_3"]._lineFeature yiels

Object { … }
__immutable_invariants_hold: true
asMutable: function B(e)​
getIn: function F(e, t)​
merge: function A(e, t)​
replace: function P(e, t)​
set: function N(e, t, r)​
setIn: function L(e, t, r)​
update: function M(e, t)​
updateIn: function U(e, t)​
without: function E(e)
&amp;lt;prototype&amp;gt;: Object { … }
// which has no similaritys to  a __esri.Graphic Object&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Apr 2025 10:20:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/state-managment-in-exp-builder/m-p/1603214#M18304</guid>
      <dc:creator>Baral_lec</dc:creator>
      <dc:date>2025-04-07T10:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: State Managment in Exp Builder</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/state-managment-in-exp-builder/m-p/1603232#M18305</link>
      <description>&lt;P&gt;The dispatch() function can only send simple objects. To handle complex objects you will need to use the MutableStoreManager.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//To send a message, with a widget id of 'widget_id', use:

//Dispatch- This should be your preferred method, as it is immutiable.
getAppStore().dispatch(appActions.widgetStatePropChange('widget_id','nameOfMessage', message))

//MutableStoreManager- Use this only if you need to send a complex object.
MutableStoreManager.getInstance().updateStateValue('widget_id', 'nameOfMessage', message)

//To read a message

//From Dispatch:
props.stateProps?.nameOfmessage

//From MutableStoreManager:
props.mutableStateProps?.nameOfmessage&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Apr 2025 12:52:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/state-managment-in-exp-builder/m-p/1603232#M18305</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2025-04-07T12:52:39Z</dc:date>
    </item>
  </channel>
</rss>

