UNPKG

@sussudio/base

Version:

Internal APIs for VS Code's utilities and user interface building blocks.

15 lines (14 loc) 669 B
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Emitter } from './event.mjs'; export class Sequence { elements = []; _onDidSplice = new Emitter(); onDidSplice = this._onDidSplice.event; splice(start, deleteCount, toInsert = []) { this.elements.splice(start, deleteCount, ...toInsert); this._onDidSplice.fire({ start, deleteCount, toInsert }); } }