Nifty Procrastination Machine
    Have ideas to improve npm?Join in the discussion! »

    aborter
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    Aborter

    A minimal reimplementation of AbortController and AbortSignal.

    This library is only 0.8kb minified, but it's not strictly spec-compliant, if you need that go with abort-controller.

    Install

    npm install --save aborter

    Usage

    import Aborter from 'aborter';
    
    const aborter = new Aborter ();
    
    console.log ( aborter.signal.aborted ); // => false
    
    aborter.signal.addEventListener ( 'abort', () => {
    
      console.log ( aborter.signal.aborted ); // => true
    
    });
    
    aborter.abort (); // Aborting, causing event handlers to be triggered and the "aborted" property to be set to "true"

    License

    MIT © Fabio Spampinato

    Install

    npm i aborter

    DownloadsWeekly Downloads

    20

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    8.57 kB

    Total Files

    15

    Last publish

    Collaborators

    • avatar