@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 976 B
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
const n={remove:()=>{}};function e(e){return e?{remove(){e&&(e(),e=void 0)}}:n}function o(n){n.forEach((n=>n?.remove()))}function r(n){o(n),n.length=0}function t(n){return e((()=>o(n)))}function u(n){return e((()=>n()?.remove()))}function i(n){return e((()=>n?.abort()))}function c(n){return e(null!=n?()=>n.destroy():void 0)}function f(n){return"object"==typeof n&&!!n&&"remove"in n&&"function"==typeof n.remove}function l(n){f(n)&&n.remove()}function v(n,o){let r=!1,t=null;return n.then((n=>{r?n.remove():t=n})),e((()=>{r=!0,null!=t?t.remove():null!=o&&(o.abort(),o=null)}))}function m(n){return{[Symbol.dispose](){n.remove()}}}export{i as abortHandle,v as asyncHandle,c as destroyHandle,m as disposable,r as drainHandles,t as handlesGroup,f as isHandle,e as makeHandle,u as refHandle,o as removeHandles,l as removeIfHandle};