@benev/slate
Version:
frontend web stuff
18 lines • 421 B
JavaScript
/** @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