@wopjs/disposable - v0.1.24
    Preparing search index...

    Variable abortableConst

    abortable: (disposable: DisposableType) => DisposableDisposer = ...

    Enhance a Disposer so that it can be safely self-disposed.

    If it is attached to a DisposableStore, it will be removed from the store automatically when self-disposed.

    Type Declaration

    let timeoutId;
    const disposer = abortable(() => clearTimeout(timeoutId));
    timeoutId = setTimeout(() => console.log("hello"), 1000);

    // Add to a store
    const disposable = new DisposableStore();
    disposable.add(disposer);

    // Self-dispose
    disposer(); // setTimeout is cleared and the disposer is removed from the store.