export default class e{_count=0;_handle;_getHandle;constructor(e){this._getHandle=e}add(){null==this._handle&&(this._handle=this._getHandle()),this._count++;let e=!1;return{remove:()=>{e||(this._remove(),e=!0)}}}_remove(){this._count--,0===this._count&&(this._handle?.remove(),this._handle=void 0)}}