<?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 Popup Capture Close Event In 4.2x in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-capture-close-event-in-4-2x/m-p/1295262#M81291</link>
    <description>&lt;P&gt;In 4.25 I get this warning&lt;/P&gt;&lt;P&gt;[esri.core.watchUtils]&lt;/P&gt;&lt;P&gt;DEPRECATED - Module: esri/core/watchUtils&lt;/P&gt;&lt;P&gt;️ Replacement: esri/core/reactiveUtils&lt;BR /&gt;:gear:Version: 4.24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to use reactiveUtils but without success, the watchUtils example in&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-actions-capture-close-event/td-p/263372" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-actions-capture-close-event/td-p/263372 &lt;/A&gt;&lt;/P&gt;&lt;P&gt;works ok.&lt;/P&gt;&lt;P&gt;Here is the example that works and the other that I'm not able to get to work.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//works!
watchUtils.whenTrue(view.popup,'visible', () =&amp;gt; {
	watchUtils.whenFalseOnce(view.popup,'visible', () =&amp;gt; {
	  console.info('popup has been closed');
	})
});
//doesn't work
reactiveUtils.whenOnce(() =&amp;gt; view.popup.visible).then(() =&amp;gt; {
	reactiveUtils.whenOnce(() =&amp;gt; !view.popup.visible).then(() =&amp;gt; {
	  console.info('how to get here?');
	})
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;A hybrid solution seems to work but I want to remove 'watchUtils' so it's not an option.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//this hybrid works
reactiveUtils.whenOnce(() =&amp;gt; view.popup.visible).then(() =&amp;gt; {
	watchUtils.whenFalseOnce(view.popup,'visible', () =&amp;gt; {
	  console.info('popup has been closed');
	})
});&lt;/LI-CODE&gt;&lt;P&gt;Any suggestions how to proceed?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2023 05:13:21 GMT</pubDate>
    <dc:creator>PasiSavolainen</dc:creator>
    <dc:date>2023-06-02T05:13:21Z</dc:date>
    <item>
      <title>Popup Capture Close Event In 4.2x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-capture-close-event-in-4-2x/m-p/1295262#M81291</link>
      <description>&lt;P&gt;In 4.25 I get this warning&lt;/P&gt;&lt;P&gt;[esri.core.watchUtils]&lt;/P&gt;&lt;P&gt;DEPRECATED - Module: esri/core/watchUtils&lt;/P&gt;&lt;P&gt;️ Replacement: esri/core/reactiveUtils&lt;BR /&gt;:gear:Version: 4.24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to use reactiveUtils but without success, the watchUtils example in&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-actions-capture-close-event/td-p/263372" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-actions-capture-close-event/td-p/263372 &lt;/A&gt;&lt;/P&gt;&lt;P&gt;works ok.&lt;/P&gt;&lt;P&gt;Here is the example that works and the other that I'm not able to get to work.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//works!
watchUtils.whenTrue(view.popup,'visible', () =&amp;gt; {
	watchUtils.whenFalseOnce(view.popup,'visible', () =&amp;gt; {
	  console.info('popup has been closed');
	})
});
//doesn't work
reactiveUtils.whenOnce(() =&amp;gt; view.popup.visible).then(() =&amp;gt; {
	reactiveUtils.whenOnce(() =&amp;gt; !view.popup.visible).then(() =&amp;gt; {
	  console.info('how to get here?');
	})
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;A hybrid solution seems to work but I want to remove 'watchUtils' so it's not an option.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//this hybrid works
reactiveUtils.whenOnce(() =&amp;gt; view.popup.visible).then(() =&amp;gt; {
	watchUtils.whenFalseOnce(view.popup,'visible', () =&amp;gt; {
	  console.info('popup has been closed');
	})
});&lt;/LI-CODE&gt;&lt;P&gt;Any suggestions how to proceed?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 05:13:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-capture-close-event-in-4-2x/m-p/1295262#M81291</guid>
      <dc:creator>PasiSavolainen</dc:creator>
      <dc:date>2023-06-02T05:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Capture Close Event In 4.2x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-capture-close-event-in-4-2x/m-p/1295394#M81293</link>
      <description>&lt;P&gt;If you just care about when the popup is closed, you don't need to capture when it's opened. You could, but it just depends on what you want to do.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;when(
	() =&amp;gt; view.popup?.visible,
	() =&amp;gt; {
		whenOnce(() =&amp;gt; !view.popup.visible).then(() =&amp;gt;
			console.log("Popup closed after opened")
		);
	}
);

// just capture when it closes
when(
	() =&amp;gt; !view.popup?.visible,
	() =&amp;gt; console.log("Popup closed")
);&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/MWPNEyV?editors=1000" target="_blank"&gt;https://codepen.io/odoe/pen/MWPNEyV?editors=1000&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 15:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-capture-close-event-in-4-2x/m-p/1295394#M81293</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2023-06-02T15:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Capture Close Event In 4.2x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-capture-close-event-in-4-2x/m-p/1295396#M81294</link>
      <description>&lt;P&gt;This sample shows different ways of using reactiveUtils:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=watch-for-changes-reactiveutils" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=watch-for-changes-reactiveutils&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you want to watch a change only once then you can use reactiveUtils.whenOnce, please take a look at the doc and code snippets:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html#whenOnce" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html#whenOnce&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 15:08:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-capture-close-event-in-4-2x/m-p/1295396#M81294</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-06-02T15:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Capture Close Event In 4.2x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-capture-close-event-in-4-2x/m-p/1295697#M81299</link>
      <description>&lt;P&gt;Thanks! Both of these examples worked fine!&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 07:45:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-capture-close-event-in-4-2x/m-p/1295697#M81299</guid>
      <dc:creator>PasiSavolainen</dc:creator>
      <dc:date>2023-06-05T07:45:39Z</dc:date>
    </item>
  </channel>
</rss>

