<?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: First calls to sendMessageToClient not used applied in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-calls-to-sendmessagetoclient-not-used/m-p/1411283#M84365</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;We addressed this behavior and now you do not need to wait for the layerView.updating becomes false for the first time. You can test the new behavior against our &lt;A href="https://github.com/Esri/feedback-js-api-next/blob/main/CHANGELOG.md" target="_blank" rel="noopener"&gt;next version&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a codepen showing the fix:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/NWmMRZa?editors=1001" target="_blank"&gt;https://codepen.io/U_B_U/pen/NWmMRZa?editors=1001&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2024 22:40:57 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2024-04-17T22:40:57Z</dc:date>
    <item>
      <title>First calls to sendMessageToClient not used applied</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-calls-to-sendmessagetoclient-not-used/m-p/1407481#M84259</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm experiencing some problems with the ArcGIS JS SDK's StreamLayer.&lt;/P&gt;&lt;P&gt;It seems that an initial call to sendMessageToClient() is not being considered.&lt;/P&gt;&lt;P&gt;If I change the timeout in &lt;A href="https://codepen.io/Kiachma/pen/ZEqgOVQ?editors=1111" target="_new"&gt;https://codepen.io/Kiachma/pen/ZEqgOVQ?editors=1111&lt;/A&gt; to something less than 2000 as it is now, then the example doesn't work. Is this a bug or do I need to add some checks before I call sendMessageToClient? I assumed that I could call sendMessageToClient without a timeout.&lt;/P&gt;&lt;P&gt;The example is based on &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#clientside-streamlayer" target="_new"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#clientside-streamlayer&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 09 Apr 2024 12:57:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-calls-to-sendmessagetoclient-not-used/m-p/1407481#M84259</guid>
      <dc:creator>snlasystem</dc:creator>
      <dc:date>2024-04-09T12:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: First calls to sendMessageToClient not used applied</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-calls-to-sendmessagetoclient-not-used/m-p/1407588#M84267</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I looked at the behavior more. &amp;nbsp;We will update the sample.&lt;/P&gt;&lt;P&gt;In any case, the first call to sendMessageToClient() should be when the StreamLayerView is fully loaded and ready. I updated your codepen to show the correct workflow:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/NWmMRZa?editors=1001" target="_blank"&gt;https://codepen.io/U_B_U/pen/NWmMRZa?editors=1001&amp;nbsp;&lt;/A&gt;the main change being what is shown below.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.whenLayerView(layer).then( async (layerView) =&amp;gt;{
  await reactiveUtils.whenOnce(() =&amp;gt; !layerView.updating);
  layerView.on("message-received", (event) =&amp;gt;{
    console.log("message-received event", event);
  });
  layer.sendMessageToClient({YOUR MESSAGE});
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 15:57:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-calls-to-sendmessagetoclient-not-used/m-p/1407588#M84267</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2024-04-09T15:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: First calls to sendMessageToClient not used applied</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-calls-to-sendmessagetoclient-not-used/m-p/1411283#M84365</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;We addressed this behavior and now you do not need to wait for the layerView.updating becomes false for the first time. You can test the new behavior against our &lt;A href="https://github.com/Esri/feedback-js-api-next/blob/main/CHANGELOG.md" target="_blank" rel="noopener"&gt;next version&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a codepen showing the fix:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/NWmMRZa?editors=1001" target="_blank"&gt;https://codepen.io/U_B_U/pen/NWmMRZa?editors=1001&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 22:40:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-calls-to-sendmessagetoclient-not-used/m-p/1411283#M84365</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2024-04-17T22:40:57Z</dc:date>
    </item>
  </channel>
</rss>

