<?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 Re: JS API/Vue watch for data store changes in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-vue-watch-for-data-store-changes/m-p/402028#M37000</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Todd, thanks for the reply. I assumed the concept would be close enough between Vue/React that just the general idea of the "how" would be enough for me to figure it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the esri-loader for my map components, just seemed like the easiest way to do it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I semi-figured out a solution for now, by just using Vue's built in store watcher within the map JS, then using its on change events to update the data I need updated. Not sure if it's the most elegant solution but it'll work for now.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------&lt;/P&gt;&lt;DIV style="color: #cdd3de; background-color: #1b2b34; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ec5f67;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;$store&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #6699cc;"&gt;watch&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;()&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c594c5;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ec5f67;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;$store&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;state&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;DefinitionExpression,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;newExpression&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c594c5;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pointLayer&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;definitionExpression&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;newExpression&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;polygonLayer&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;definitionExpression&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;newExpression&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;I'm certainty going to dig into finding something similar to a React Context in Vue that seems like a better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Feb 2020 19:55:02 GMT</pubDate>
    <dc:creator>ShawnRoberts1</dc:creator>
    <dc:date>2020-02-05T19:55:02Z</dc:date>
    <item>
      <title>JS API/Vue watch for data store changes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-vue-watch-for-data-store-changes/m-p/402026#M36998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the best way to have the map watch for changes a data store. (on change do something inside the map).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a map as a component which I'd like to bind its definition query to something set in the store. I'm doing it this way as the users interact with a side panel (which IS NOT in the map), so I'm having it update a value in the store via mutations. From there I'd like the map to watch for changes to that value and simply update a layers definition query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can access the data store perfectly fine from within the map this.$store.state.DefinitionQuery gives me the value I want. But when I try to set the watchUtils watch that value is fires multiple promise and other errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not committed to this data structure so if anyone has a better way to have the map respond to changes in other components (**not a widget in the map***) I'm open to the ideas as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached an example of the map component I've got so far. Right now I'm just trying to make it log on a change, but once I figure out the onChange event I'll bind the pointLayer.definitionQuery to it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2020 17:22:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-vue-watch-for-data-store-changes/m-p/402026#M36998</guid>
      <dc:creator>ShawnRoberts1</dc:creator>
      <dc:date>2020-02-05T17:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: JS API/Vue watch for data store changes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-vue-watch-for-data-store-changes/m-p/402027#M36999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will preface that I'm not familiar with vue but I do something similar to what you're doing&amp;nbsp;in React...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you instantiating your map and map components with &lt;A href="https://github.com/Esri/esri-loader"&gt;esri-loader&lt;/A&gt;? Or are you doing it the "regular" way outside of vue? If using esri-loader could you use the bullt-in methods in vue to observe your store updates&amp;nbsp;change then update the def query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In React, I use the Context API that stores the various bits of data that go into the def query and the user can manipulate this data via some UI. On UI input, it updates the def query and my map component (technically a layer component) sees that update through the native React Context API and and updates the layer's def query as needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2020 17:59:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-vue-watch-for-data-store-changes/m-p/402027#M36999</guid>
      <dc:creator>ToddAtkins</dc:creator>
      <dc:date>2020-02-05T17:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: JS API/Vue watch for data store changes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-vue-watch-for-data-store-changes/m-p/402028#M37000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Todd, thanks for the reply. I assumed the concept would be close enough between Vue/React that just the general idea of the "how" would be enough for me to figure it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the esri-loader for my map components, just seemed like the easiest way to do it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I semi-figured out a solution for now, by just using Vue's built in store watcher within the map JS, then using its on change events to update the data I need updated. Not sure if it's the most elegant solution but it'll work for now.&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------&lt;/P&gt;&lt;DIV style="color: #cdd3de; background-color: #1b2b34; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ec5f67;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;$store&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #6699cc;"&gt;watch&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;()&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c594c5;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ec5f67;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;$store&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;state&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;DefinitionExpression,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;newExpression&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c594c5;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pointLayer&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;definitionExpression&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;newExpression&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;polygonLayer&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;definitionExpression&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;newExpression&lt;/SPAN&gt;&lt;SPAN style="color: #5fb3b3;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #cdd3de;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;I'm certainty going to dig into finding something similar to a React Context in Vue that seems like a better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2020 19:55:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-vue-watch-for-data-store-changes/m-p/402028#M37000</guid>
      <dc:creator>ShawnRoberts1</dc:creator>
      <dc:date>2020-02-05T19:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: JS API/Vue watch for data store changes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-vue-watch-for-data-store-changes/m-p/402029#M37001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah I think you're on the right track and to me (as a non vue guy, lol) it looks like your solution is a good one.&amp;nbsp;Glad you got it working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2020 12:26:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-vue-watch-for-data-store-changes/m-p/402029#M37001</guid>
      <dc:creator>ToddAtkins</dc:creator>
      <dc:date>2020-02-06T12:26:59Z</dc:date>
    </item>
  </channel>
</rss>

