UNPKG

@benev/slate

Version:
18 lines 421 B
/** @deprecated use `Trashbin` instead */ export class Trashcan { #can = []; bag = (item) => ({ dump: (destroy) => { this.#can.push(() => destroy(item)); return item; } }); mark = (fn) => { this.#can.push(fn); }; dispose = () => { this.#can.forEach(destroy => destroy()); this.#can = []; }; } //# sourceMappingURL=trashcan.js.map