UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 572 B
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ var t;const s=Symbol();class o{static{t=s}constructor(s){this._operations=[],this._closed=!1,this[t]=!0,s&&(this._operations=s,this._closed=!0)}close(){this._closed=!0}apply(){for(const t of this._operations)t.apply()}undo(){for(let t=this._operations.length-1;t>=0;t--)this._operations[t].undo()}accumulate(t){if(this._closed)return!1;const s=this._operations.length?this._operations[this._operations.length-1]:null;return s&&s.accumulate(t)||(this._operations.push(t),t.apply()),!0}}export{o as UndoGroup};