@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 707 B
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
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};