<?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 ArcGIS for JS + TypeScript + reactiveUtils in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-for-js-typescript-reactiveutils/m-p/1202313#M78267</link>
    <description>&lt;P&gt;Hi everybody,&lt;BR /&gt;I can't use the method &lt;STRONG&gt;.watch&amp;nbsp;&lt;/STRONG&gt; (&lt;STRONG&gt;reactiveUtils.watch)&lt;/STRONG&gt;&lt;BR /&gt;and I do not know why.&lt;/P&gt;&lt;P&gt;Classic JS ( with js api 4.20 ) and watchUtils.watch worked fine,&lt;BR /&gt;but with JS ( TypeScript - js api 4.24) I have problem.&lt;/P&gt;&lt;P&gt;And for completeness:&lt;BR /&gt;npm list&lt;BR /&gt;api-ts@1.0.0 D:\groupApp\appc&lt;BR /&gt;+-- @types/arcgis-js-api@4.24.0&lt;BR /&gt;+-- npx@10.2.2&lt;BR /&gt;`-- typescript@4.7.4&lt;/P&gt;&lt;P&gt;tsconfig.json:&lt;BR /&gt;...&lt;BR /&gt;"compilerOptions": {&lt;BR /&gt;"lib": ["ES2015","ES2015.Promise", "DOM"],&lt;BR /&gt;"module": "AMD",&lt;BR /&gt;"sourceMap": true,&lt;BR /&gt;"strict": true,&lt;BR /&gt;"target": "ES5",&lt;BR /&gt;"noImplicitAny": true,&lt;BR /&gt;"suppressImplicitAnyIndexErrors":true,&lt;BR /&gt;"esModuleInterop": true&lt;BR /&gt;}&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am attaching a piece of code from the file main.ts:&lt;BR /&gt;main.ts:&lt;BR /&gt;import ArcGISMap from "esri/Map";&lt;BR /&gt;import MapView from "esri/views/MapView";&lt;BR /&gt;import MIL from "esri/layers/MapImageLayer";&lt;BR /&gt;&lt;STRONG&gt;import rU from "esri/core/reactiveUtils&lt;/STRONG&gt;";&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;const mapLay_1 = new MIL({&lt;BR /&gt;url:"https://..../MapServer",&lt;BR /&gt;title:"XXXXXX"&lt;BR /&gt;})&lt;BR /&gt;map.add(mapLay_1);&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;view.when(() =&amp;gt; {&lt;/P&gt;&lt;P&gt;mapLay_1.when(() =&amp;gt; {&lt;BR /&gt;console.log("# info mapLay_1: ",mapLay_1) // &lt;STRONG&gt;&lt;EM&gt;I see, that is OK - layer is loaded&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;rU.watch(() =&amp;gt; mapLay_1.visible, (visible) =&amp;gt; {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;console.log("??? reactiveUtils ??? &amp;gt;&amp;gt;&amp;gt;&amp;gt; ",mapLay_1.title, "visible:", mapLay_1.visible)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;})&lt;/P&gt;&lt;P&gt;}) //view.when(&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have error in JS console:&lt;/STRONG&gt;&lt;BR /&gt;Using ArcGIS API for JavaScript 4.24 [Date: 20220706, Revision: 7fd01dbc]&lt;BR /&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'watch')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you for your help&lt;/STRONG&gt;&lt;BR /&gt;Zdenek Procner&lt;/P&gt;</description>
    <pubDate>Fri, 12 Aug 2022 09:33:11 GMT</pubDate>
    <dc:creator>Zdenekprocner</dc:creator>
    <dc:date>2022-08-12T09:33:11Z</dc:date>
    <item>
      <title>ArcGIS for JS + TypeScript + reactiveUtils</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-for-js-typescript-reactiveutils/m-p/1202313#M78267</link>
      <description>&lt;P&gt;Hi everybody,&lt;BR /&gt;I can't use the method &lt;STRONG&gt;.watch&amp;nbsp;&lt;/STRONG&gt; (&lt;STRONG&gt;reactiveUtils.watch)&lt;/STRONG&gt;&lt;BR /&gt;and I do not know why.&lt;/P&gt;&lt;P&gt;Classic JS ( with js api 4.20 ) and watchUtils.watch worked fine,&lt;BR /&gt;but with JS ( TypeScript - js api 4.24) I have problem.&lt;/P&gt;&lt;P&gt;And for completeness:&lt;BR /&gt;npm list&lt;BR /&gt;api-ts@1.0.0 D:\groupApp\appc&lt;BR /&gt;+-- @types/arcgis-js-api@4.24.0&lt;BR /&gt;+-- npx@10.2.2&lt;BR /&gt;`-- typescript@4.7.4&lt;/P&gt;&lt;P&gt;tsconfig.json:&lt;BR /&gt;...&lt;BR /&gt;"compilerOptions": {&lt;BR /&gt;"lib": ["ES2015","ES2015.Promise", "DOM"],&lt;BR /&gt;"module": "AMD",&lt;BR /&gt;"sourceMap": true,&lt;BR /&gt;"strict": true,&lt;BR /&gt;"target": "ES5",&lt;BR /&gt;"noImplicitAny": true,&lt;BR /&gt;"suppressImplicitAnyIndexErrors":true,&lt;BR /&gt;"esModuleInterop": true&lt;BR /&gt;}&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am attaching a piece of code from the file main.ts:&lt;BR /&gt;main.ts:&lt;BR /&gt;import ArcGISMap from "esri/Map";&lt;BR /&gt;import MapView from "esri/views/MapView";&lt;BR /&gt;import MIL from "esri/layers/MapImageLayer";&lt;BR /&gt;&lt;STRONG&gt;import rU from "esri/core/reactiveUtils&lt;/STRONG&gt;";&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;const mapLay_1 = new MIL({&lt;BR /&gt;url:"https://..../MapServer",&lt;BR /&gt;title:"XXXXXX"&lt;BR /&gt;})&lt;BR /&gt;map.add(mapLay_1);&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;view.when(() =&amp;gt; {&lt;/P&gt;&lt;P&gt;mapLay_1.when(() =&amp;gt; {&lt;BR /&gt;console.log("# info mapLay_1: ",mapLay_1) // &lt;STRONG&gt;&lt;EM&gt;I see, that is OK - layer is loaded&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;rU.watch(() =&amp;gt; mapLay_1.visible, (visible) =&amp;gt; {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;console.log("??? reactiveUtils ??? &amp;gt;&amp;gt;&amp;gt;&amp;gt; ",mapLay_1.title, "visible:", mapLay_1.visible)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;})&lt;/P&gt;&lt;P&gt;}) //view.when(&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have error in JS console:&lt;/STRONG&gt;&lt;BR /&gt;Using ArcGIS API for JavaScript 4.24 [Date: 20220706, Revision: 7fd01dbc]&lt;BR /&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'watch')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you for your help&lt;/STRONG&gt;&lt;BR /&gt;Zdenek Procner&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 09:33:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-for-js-typescript-reactiveutils/m-p/1202313#M78267</guid>
      <dc:creator>Zdenekprocner</dc:creator>
      <dc:date>2022-08-12T09:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS for JS + TypeScript + reactiveUtils</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-for-js-typescript-reactiveutils/m-p/1202367#M78271</link>
      <description>&lt;P&gt;reactiveUtils doesn't have a default export, so you can do one of two things.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// import all methods
import * as rU from "@arcgis/core/core/reactiveUtils";

// only import the method you're interested in
import { watch } from "@arcgis/core/core/reactiveUtils";&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Aug 2022 13:56:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-for-js-typescript-reactiveutils/m-p/1202367#M78271</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-08-12T13:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS for JS + TypeScript + reactiveUtils</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-for-js-typescript-reactiveutils/m-p/1202731#M78286</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;yes, you are absolutely right.&lt;BR /&gt;&lt;STRONG&gt;Thank&lt;/STRONG&gt; you for your answer.&lt;BR /&gt;Zdeněk Procner&lt;/P&gt;&lt;P&gt;import * as rU from "esri/core/reactiveUtils";&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 06:46:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-for-js-typescript-reactiveutils/m-p/1202731#M78286</guid>
      <dc:creator>Zdenekprocner</dc:creator>
      <dc:date>2022-08-15T06:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS for JS + TypeScript + reactiveUtils</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-for-js-typescript-reactiveutils/m-p/1202736#M78287</link>
      <description>&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/es-modules/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/es-modules/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;At the top of each module's API Reference page is guidance on which import syntax to use:&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;default&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;namespace&lt;/EM&gt;&lt;SPAN&gt;. Most of the modules use a default import syntax as shown in the&amp;nbsp;&lt;/SPAN&gt;import WebMap&lt;SPAN&gt;&amp;nbsp;Class example above. Other modules, such as those providing helper functions, use a namespace import similar to the&amp;nbsp;&lt;/SPAN&gt;import * as projection&lt;SPAN&gt;&amp;nbsp;example. Depending on your stylistic preference, instead of a namespace import you can also use a&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;named&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;import to reference the exact method that you need.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 07:49:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-for-js-typescript-reactiveutils/m-p/1202736#M78287</guid>
      <dc:creator>Zdenekprocner</dc:creator>
      <dc:date>2022-08-15T07:49:41Z</dc:date>
    </item>
  </channel>
</rss>

