<?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: Accessing the JS API via a web worker in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85126#M7698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the responses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using 4.3 and I have been staring at the frame work but hesitate 'jumping down the rabbit hole' if what I am trying to do is not possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I have a couple of specific questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1.)&lt;/STRONG&gt; Would I be able to do the following inside the worker:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;require(["esri/geometry/geometryEngine", "esri/geometry/Extent", "esri/geometry/Polygon"&amp;nbsp;], someFunctionInTheWorker)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2.)&lt;/STRONG&gt;&amp;nbsp;Is the worker a true worker and what I mean here is, can I still use &lt;STRONG&gt;postMessage() and onmessage&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;I would like to send a progress message back several times before I send the final result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3.)&lt;/STRONG&gt;&amp;nbsp;If I serialize to&amp;nbsp;JSON will&amp;nbsp;I get everything back on the other side. For example, will a polygon object still have a &lt;STRONG&gt;centroid&lt;/STRONG&gt;?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 May 2017 15:38:58 GMT</pubDate>
    <dc:creator>RobertHewlett</dc:creator>
    <dc:date>2017-05-16T15:38:58Z</dc:date>
    <item>
      <title>Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85122#M7694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to offload some of the heavy lifting in a web app to a web worker.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is a&amp;nbsp;2-3 second jank I would like gone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now the web worker would still need access to parts of the API e.g. Extent and Polygon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried loading the init.js script via importScripts() but I still get errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone had any success with the ArcGIS JS-API inside a web worker ... not outside but inside.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 May 2017 21:51:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85122#M7694</guid>
      <dc:creator>RobertHewlett</dc:creator>
      <dc:date>2017-05-15T21:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85123#M7695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I have tried in the past and came to the conclusion that you can not interact with the API inside a web worker. I have been able to do simple or even complex math or JS operations but not use esri classes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 12:09:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85123#M7695</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-05-16T12:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85124#M7696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems to me that importScripts is the right way to handle this. &amp;nbsp;JavaScript doesn't allow you to share between threads currently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would imagine that there are limitations to what can be imported, and it may be difficult to import the entire JS API for various reasons. &amp;nbsp;For instance the worker's global scope is different from the normal JavaScript global scope, and the JS API probably relies on the normal global scope&amp;nbsp;in&amp;nbsp;some places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It&amp;nbsp;may be possible to build the modules you need into a single file (Extent, Polygon, and all dependencies) and pull this in via importScripts, assuming there's no issues with those modules running in the worker's scope. &amp;nbsp;I don't know&amp;nbsp;much about the details here though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 13:11:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85124#M7696</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2017-05-16T13:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85125#M7697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using 4x, there is a Worker framework in the API that we use for some of our internal processing of things like VectorTiles.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html"&gt;Connection | API Reference | ArcGIS API for JavaScript 4.3&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are limitations to what currently works in a Worker, for example esri/request works in a Worker, but in 4.3, Authentication does not, unless you authenticate on the main thread first. You also can't pass Geometries from workers to the main thread, you need to convert them to JSON first, but if your main thread used a typed Collection to load that JSON, it could work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the future we'll try to add a sample or two on workers, as we can make sure other parts of the API can be loaded in workers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 15:07:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85125#M7697</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2017-05-16T15:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85126#M7698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the responses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using 4.3 and I have been staring at the frame work but hesitate 'jumping down the rabbit hole' if what I am trying to do is not possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I have a couple of specific questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1.)&lt;/STRONG&gt; Would I be able to do the following inside the worker:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;require(["esri/geometry/geometryEngine", "esri/geometry/Extent", "esri/geometry/Polygon"&amp;nbsp;], someFunctionInTheWorker)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2.)&lt;/STRONG&gt;&amp;nbsp;Is the worker a true worker and what I mean here is, can I still use &lt;STRONG&gt;postMessage() and onmessage&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;I would like to send a progress message back several times before I send the final result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3.)&lt;/STRONG&gt;&amp;nbsp;If I serialize to&amp;nbsp;JSON will&amp;nbsp;I get everything back on the other side. For example, will a polygon object still have a &lt;STRONG&gt;centroid&lt;/STRONG&gt;?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 15:38:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85126#M7698</guid>
      <dc:creator>RobertHewlett</dc:creator>
      <dc:date>2017-05-16T15:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85127#M7699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the sample for the framework there is a curios line that causes an error:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;esriConfig.workers.loaderConfig&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 16:32:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85127#M7699</guid>
      <dc:creator>RobertHewlett</dc:creator>
      <dc:date>2017-05-16T16:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85128#M7700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are my responses to these three questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Yes you can reference API modules in the worker. I have definitely used geometryEngine, jsonUtils, and promiseUtils in a worker loaded from the JSAPI. But I would use define() instead of require().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I don't know. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; cc\ &lt;A href="https://community.esri.com/people/odoe"&gt;odoe&lt;/A&gt;&amp;nbsp;&lt;A href="https://community.esri.com/people/ubatsukh-esristaff"&gt;ubatsukh-esristaff&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Yes. I serialized Graphics in a worker (including the geometries) and got everything back.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 16:42:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85128#M7700</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2017-05-16T16:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85129#M7701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Was this possible in 3.x?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 16:49:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85129#M7701</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-05-16T16:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85130#M7702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure. I've only played around with this in 4.x.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 16:51:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85130#M7702</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2017-05-16T16:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85131#M7703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actual progress (rabbit-hole-time)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Replace&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&lt;STRONG&gt;esriConfig.workers.loaderConfig stuff&lt;/STRONG&gt; in the API sample code with the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var local = window.location.href.substring(0, window.location.href.lastIndexOf('/'));&lt;BR /&gt;workers.open(this, local + "/&amp;lt;&lt;STRONG&gt;myJSdirectory&lt;/STRONG&gt;&amp;gt;/&amp;lt;&lt;STRONG&gt;nameOfMyworkscript.js&lt;/STRONG&gt;&amp;gt;")&lt;BR /&gt; .then(function(connection) {&lt;BR /&gt; return connection.invoke("max", {&lt;BR /&gt; numbers: [0, 1, 2, 3, 4]&lt;BR /&gt; });&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That seems to bridge the sample code and gets the value 4 in the console.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 17:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85131#M7703</guid>
      <dc:creator>RobertHewlett</dc:creator>
      <dc:date>2017-05-16T17:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85132#M7704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This allows you to resolve paths to your worker scripts relative to your app so you don't have to provide a full url when calling connection.open(...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers"&gt;config | API Reference | ArcGIS API for JavaScript 4.3&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 17:14:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85132#M7704</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2017-05-16T17:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85133#M7705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The client doesn't have access to the created worker, so you can't add event listeners to listen to messages. I can check if there is some other route for that or if we can expose it in some manner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample using a worker to buffer the centroid of the view extent.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://gist.github.com/odoe/2fee4a638c19dff01824acb5268acad9" title="https://gist.github.com/odoe/2fee4a638c19dff01824acb5268acad9"&gt;index.html · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 17:19:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85133#M7705</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2017-05-16T17:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85134#M7706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to make an extent in the worker and send it back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On my first attempt I sent the raw object back to the UI but the object seemed confused.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I used&amp;nbsp;JSON.stringify() and got something that made sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below:&lt;/P&gt;&lt;P&gt;{"xmin":1,"ymin":1,"xmax":10,"ymax":10,"spatialReference":{"wkid":4326}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inside the worker (BTW I flatten my code i.e. avoid fx nesting at all costs):&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define(["esri/core/promiseUtils", "esri/geometry/geometryEngine", "esri/geometry/Extent", "esri/geometry/Polygon"], work);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function work(promiseUtils, ge, Extent, Polygon) {&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;env = new Extent( 1, 1, 10, 10); &lt;BR /&gt; return promiseUtils.resolve({data: JSON.stringify(env)});&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 17:33:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85134#M7706</guid>
      <dc:creator>RobertHewlett</dc:creator>
      <dc:date>2017-05-16T17:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85135#M7707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;No need to convert it to a string, but you do need to convert the JS object to JSON:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; promiseUtils&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;resolve&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toJSON&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then recreate the Extent in your main thread by passing in the JSON directly to the Extent constructor:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 17:44:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85135#M7707</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2017-05-16T17:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85136#M7708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just updated this gist to handle worker communication for things like progress updates&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://gist.github.com/odoe/2fee4a638c19dff01824acb5268acad9" title="https://gist.github.com/odoe/2fee4a638c19dff01824acb5268acad9" rel="nofollow noopener noreferrer" target="_blank"&gt;index.html · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turns out you can pass an object as the first argument to workers.open(). You can then invoke any functions from the worker on this argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// client&lt;/SPAN&gt;
workers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;open&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; progress&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;msg&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"progress:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; msg&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; promiseUtils&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;resolve&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;msg&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; workerUrl&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// worker&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; Request &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 Request&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;prototype&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;magic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;magic&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; extent &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; proxy &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; proxy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;connection&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;invoke&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"progress"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"starting"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; area &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Polygon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;fromExtent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;fromJSON&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; proxy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;connection&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;invoke&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"progress"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"polygon created"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; centroid &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; area&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;centroid&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; proxy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;connection&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;invoke&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"progress"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"centroid found"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; ptBuff &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geometryEngine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;buffer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;centroid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"feet"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; proxy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;connection&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;invoke&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"progress"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"buffer created"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ptBuff&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toJSON&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; proxy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;connection&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;invoke&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"progress"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"buffer serialized"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; promiseUtils&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;resolve&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; data &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; Request&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:16:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85136#M7708</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-10T23:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85137#M7709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 20:17:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85137#M7709</guid>
      <dc:creator>RobertHewlett</dc:creator>
      <dc:date>2017-05-16T20:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85138#M7710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rene,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am newbie on this part of the API so my conceptual thinking might be off but ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is &lt;STRONG&gt;proxy.connection.invoke&lt;/STRONG&gt; basically the worker invoking one of its own methods/functions as this is usually done from the client side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the there a list of client side objects you can send into the worker and from within the worker call these methods/functions back in the client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 20:34:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85138#M7710</guid>
      <dc:creator>RobertHewlett</dc:creator>
      <dc:date>2017-05-16T20:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85139#M7711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"&lt;SPAN style="background-color: #ffffff;"&gt;You can then invoke any functions from the worker on this argument.&lt;/SPAN&gt;"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What if the function updated the client UI?&amp;nbsp;BOOM?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 20:39:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85139#M7711</guid>
      <dc:creator>RobertHewlett</dc:creator>
      <dc:date>2017-05-16T20:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85140#M7712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not invoking a method on itself, the proxy.connection invoking a method on the object you are passing to workers.open(), that exist on the client. It can be anything you want, it just needs to have a method that returns a promise, because it's also a way for you to request information from the main thread from within the worker.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 May 2017 21:30:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85140#M7712</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2017-05-16T21:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the JS API via a web worker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85141#M7713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a heads up for others. Once I started using the proxy.connection as shown&amp;nbsp;in the gist-sample the variable names on the client-side and the web-worker side had to match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might be a chrome-thing, transferable object-thing or a AJS-connection framework-thing. Not sure as I am a newbie to this part of the API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I do this on the non-web-worker side&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; connection&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;invoke&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"someFX"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; argsAsJSON &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then inside the web-worker I had to make the variable names match:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Request&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;prototype&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;someFX &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;someFX&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;argsAsJSON&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;proxy&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If I used another variable name then that variable would be undefined:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Request.prototype.someFX = function someFX({data}, {proxy}) {&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The line above (in the chrome debugger) would report data as undefined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 23:07:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-the-js-api-via-a-web-worker/m-p/85141#M7713</guid>
      <dc:creator>RobertHewlett</dc:creator>
      <dc:date>2017-05-17T23:07:17Z</dc:date>
    </item>
  </channel>
</rss>

