<?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 trying to understand view + model + state management in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-understand-view-model-state-management/m-p/27235#M2352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm starting to learn version 4 of the API and trying to develop a custom widget that runs a geoprocessing tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried to follow a sample but it's&amp;nbsp;quite overwhelming and hard to follow the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to implement a button click that will send a request to a service (promise), then respond accordingly. Basically, I would like to show a loader while the promise is running and then "turn off" the loader when I have the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a floating panel with a button, I have an async function to send a request using the geoprocessing example from the API, but I can't figure how to implement the state management properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the example I found, I divided my code&amp;nbsp;into 2 files - 1 is for the View/UI, 2nd is the ViewModel.&lt;/P&gt;&lt;P&gt;I've tried to use the get property in the ViewModel to be used as a status, which can be read from the View... But I couldn't figure out how to&amp;nbsp;change and track that property and everything got really messy at that point.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone knows of a simple example for this I can use?&lt;/P&gt;&lt;P&gt;ViewModel + status property to "watch" for changes,&amp;nbsp; then a View that reads the &lt;SPAN&gt;status&amp;nbsp;&lt;/SPAN&gt;property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Jul 2020 14:07:00 GMT</pubDate>
    <dc:creator>shaylavi</dc:creator>
    <dc:date>2020-07-18T14:07:00Z</dc:date>
    <item>
      <title>trying to understand view + model + state management</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-understand-view-model-state-management/m-p/27235#M2352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm starting to learn version 4 of the API and trying to develop a custom widget that runs a geoprocessing tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried to follow a sample but it's&amp;nbsp;quite overwhelming and hard to follow the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to implement a button click that will send a request to a service (promise), then respond accordingly. Basically, I would like to show a loader while the promise is running and then "turn off" the loader when I have the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a floating panel with a button, I have an async function to send a request using the geoprocessing example from the API, but I can't figure how to implement the state management properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the example I found, I divided my code&amp;nbsp;into 2 files - 1 is for the View/UI, 2nd is the ViewModel.&lt;/P&gt;&lt;P&gt;I've tried to use the get property in the ViewModel to be used as a status, which can be read from the View... But I couldn't figure out how to&amp;nbsp;change and track that property and everything got really messy at that point.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone knows of a simple example for this I can use?&lt;/P&gt;&lt;P&gt;ViewModel + status property to "watch" for changes,&amp;nbsp; then a View that reads the &lt;SPAN&gt;status&amp;nbsp;&lt;/SPAN&gt;property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jul 2020 14:07:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-understand-view-model-state-management/m-p/27235#M2352</guid>
      <dc:creator>shaylavi</dc:creator>
      <dc:date>2020-07-18T14:07:00Z</dc:date>
    </item>
  </channel>
</rss>

