@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 623 B
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../arcade.js";const s=e("form-calculation");class r{constructor(){this._executors=new Map,this._executorPromises=new Map}async getArcadeExecutor(e){return this._executors.has(e)?this._executors.get(e):this._executorPromises.has(e)?this._executorPromises.get(e):this._createExecutor(e)}async _createExecutor(e){try{const r=t(e,s);this._executorPromises.set(e,r);const o=await r;return this._executors.set(e,o),o}finally{this._executorPromises.delete(e)}}}export{r as ArcadeExecutorProvider};