UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.14 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{_ as t}from"../chunks/tslib.es6.js";import s from"./Accessor.js";import r from"./Logger.js";import{debounce as o}from"./promiseUtils.js";import{watch as e,initial as n}from"./reactiveUtils.js";import{property as i}from"./accessorSupport/decorators/property.js";import{subclass as p}from"./accessorSupport/decorators/subclass.js";const c=s=>{let c=class extends s{constructor(){super(...arguments),this._numUpdating=0}get updating(){return this._numUpdating>0}autoUpdateAsync(t,s){const i=o((async s=>{++this._numUpdating;try{const r=await s;this.destroyed||this._set(t,r)}catch(o){r.getLogger(this).warn(`Async update of "${String(t)}" failed. Async update functions should not throw exceptions.`)}--this._numUpdating}));return e(s,i,n)}};return t([i({readOnly:!0})],c.prototype,"updating",null),t([i()],c.prototype,"_numUpdating",void 0),c=t([p("esri.core.AsyncUpdate")],c),c};let a=class extends(c(s)){};a=t([p("esri.core.AsyncUpdate")],a);export{a as AsyncUpdate,c as AsyncUpdateMixin};