Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nodejs native abort-controller if available #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
An implementation of [WHATWG AbortController interface](https://dom.spec.whatwg.org/#interface-abortcontroller).

```js
import AbortController from "abort-controller"
import { AbortController } from "abort-controller"

const controller = new AbortController()
const signal = controller.signal
Expand Down Expand Up @@ -42,9 +42,9 @@ Or download from [`dist` directory](./dist).
### Basic

```js
import AbortController from "abort-controller"
import { AbortController } from "abort-controller"
// or
const AbortController = require("abort-controller")
const { AbortController } = require("abort-controller")

// or UMD version defines a global variable:
const AbortController = window.AbortControllerShim
Expand Down
4 changes: 2 additions & 2 deletions dist/abort-controller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare class AbortSignal extends EventTarget<Events, EventAttributes> {
/**
* Returns `true` if this `AbortSignal`"s `AbortController` has signaled to abort, and `false` otherwise.
*/
readonly aborted: boolean
get aborted(): boolean
}
/**
* The AbortController.
Expand All @@ -32,7 +32,7 @@ declare class AbortController {
/**
* Returns the `AbortSignal` object associated with this object.
*/
readonly signal: AbortSignal
get signal(): AbortSignal
/**
* Abort and signal to any observers that the associated activity is to be aborted.
*/
Expand Down
8 changes: 4 additions & 4 deletions dist/abort-controller.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/abort-controller.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dist/abort-controller.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,5 @@ if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
});
}

export default AbortController;
export { AbortController, AbortSignal };
//# sourceMappingURL=abort-controller.mjs.map