abort-controller
An implementation of WHATWG AbortController interface.
Last updated 6 years ago by mysticatea .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install abort-controller 
SYNC missed versions from official npm registry.

abort-controller

npm version Downloads/month Build Status Coverage Status Dependency Status

An implementation of WHATWG AbortController interface.

import AbortController from "abort-controller"

const controller = new AbortController()
const signal = controller.signal

signal.addEventListener("abort", () => {
    console.log("aborted!")
})

controller.abort()

https://jsfiddle.net/1r2994qp/1/

???? Installation

Use npm to install then use a bundler.

npm install abort-controller

Or download from dist directory.

???? Usage

import AbortController from "abort-controller"
// or
const AbortController = require("abort-controller")

// or UMD version defines a global variable:
const AbortController = window.AbortControllerShim

AbortController

https://dom.spec.whatwg.org/#interface-abortcontroller

controller.signal

The AbortSignal object which is associated to this controller.

controller.abort()

Notify abort event to listeners that the signal has.

???? Changelog

???? Contributing

Contributing is welcome ❤️

Please use GitHub issues/PRs.

Development tools

  • npm install installs dependencies for development.
  • npm test runs tests and measures code coverage.
  • npm run clean removes temporary files of tests.
  • npm run coverage opens code coverage of the previous test with your default browser.
  • npm run lint runs ESLint.
  • npm run build generates dist codes.
  • npm run watch runs tests on each file change.

Current Tags

  • 3.0.0                                ...           latest (6 years ago)
  • 3.0.0                                ...           next (6 years ago)

11 Versions

  • 3.0.0                                ...           6 years ago
  • 2.0.3                                ...           6 years ago
  • 2.0.2                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.1.0-beta.0                                ...           6 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |