All Projects → mysticatea → Abort Controller

mysticatea / Abort Controller

Licence: mit
An implementation of WHATWG AbortController interface.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Abort Controller

Rando.js
The world's easiest, most powerful random function.
Stars: ✭ 659 (+209.39%)
Mutual labels:  library, npm-package, npm-module
Ngx Smart Modal
Modal/Dialog component crafted for Angular
Stars: ✭ 256 (+20.19%)
Mutual labels:  library, npm-package, npm-module
Event Target Shim
An implementation of WHATWG EventTarget interface, plus few extensions.
Stars: ✭ 89 (-58.22%)
Mutual labels:  npm-package, npm-module
Ngx Api Utils
ngx-api-utils is a lean library of utilities and helpers to quickly integrate any HTTP API (REST, Ajax, and any other) with Angular.
Stars: ✭ 92 (-56.81%)
Mutual labels:  library, npm-package
React Ckeditor
CKEditor component for React with plugin and custom event listeners support
Stars: ✭ 124 (-41.78%)
Mutual labels:  npm-package, npm-module
Webcam Easy
javascript access webcam stream and take photo
Stars: ✭ 79 (-62.91%)
Mutual labels:  npm-package, npm-module
Node Loadbalance
A collection of distilled load balancing engines
Stars: ✭ 79 (-62.91%)
Mutual labels:  npm-package, npm-module
Bloc.js
A predictable state management library that helps implement the BLoC design pattern in JavaScript
Stars: ✭ 111 (-47.89%)
Mutual labels:  library, npm-package
Packagephobia
⚖️ Find the cost of adding a new dependency to your project
Stars: ✭ 1,110 (+421.13%)
Mutual labels:  npm-package, npm-module
Reactopt
A CLI React performance optimization tool that identifies potential unnecessary re-rendering
Stars: ✭ 1,975 (+827.23%)
Mutual labels:  npm-package, npm-module
Jails
An alternative for Javascript Vanilla Applications
Stars: ✭ 153 (-28.17%)
Mutual labels:  library, dom
Node Regedit
Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
Stars: ✭ 178 (-16.43%)
Mutual labels:  npm-package, npm-module
Anglesharp.js
👼 Extends AngleSharp with a .NET-based JavaScript engine.
Stars: ✭ 68 (-68.08%)
Mutual labels:  library, dom
Package.json
文件 package.json 的说明文档。
Stars: ✭ 67 (-68.54%)
Mutual labels:  npm-package, npm-module
Forge Node App
🛠📦🎉 Generate Node.js boilerplate with optional libraries & tools
Stars: ✭ 90 (-57.75%)
Mutual labels:  npm-package, npm-module
Dom
DOM Standard
Stars: ✭ 1,114 (+423%)
Mutual labels:  whatwg, dom
Tplink Cloud Api
A node.js npm module to remotely control TP-Link smartplugs (HS100, HS110) and smartbulbs (LB100, LB110, LB120, LB130) using their cloud web service (no need to be on the same wifi/lan)
Stars: ✭ 96 (-54.93%)
Mutual labels:  npm-package, npm-module
Htmlkit
An Objective-C framework for your everyday HTML needs.
Stars: ✭ 206 (-3.29%)
Mutual labels:  whatwg, dom
Pannellum React
React Component for Pannellum (open source panorama viewer for the web)
Stars: ✭ 48 (-77.46%)
Mutual labels:  library, npm-package
Awesome Node Utils
some useful npm packages for nodejs itself
Stars: ✭ 51 (-76.06%)
Mutual labels:  npm-package, npm-module

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

Basic

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

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

If your bundler recognizes browser field of package.json, the imported AbortController is the native one and it doesn't contain shim (even if the native implementation was nothing). If you wanted to polyfill AbortController for IE, use abort-controller/polyfill.

Polyfilling

Importing abort-controller/polyfill assigns the AbortController shim to the AbortController global variable if the native implementation was nothing.

import "abort-controller/polyfill"
// or
require("abort-controller/polyfill")

API

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].