Skip to content

Commit

Permalink
docs(abort-controller): update abort-controller documentation (#4762)
Browse files Browse the repository at this point in the history
  • Loading branch information
MYoung25 authored May 25, 2023
1 parent 4e4c7f4 commit 8874468
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/abort-controller/src/AbortController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { AbortController as IAbortController } from "@aws-sdk/types";

import { AbortSignal } from "./AbortSignal";

export { IAbortController };

/**
* This implementation was added as Node.js didn't support AbortController prior to 15.x
* Use native implementation in browsers or Node.js >=15.4.0.
* Use native implementation in browsers or Node.js \>=15.4.0.
*
* @public
*/
export class AbortController implements IAbortController {
public readonly signal: AbortSignal = new AbortSignal();
Expand Down
5 changes: 5 additions & 0 deletions packages/abort-controller/src/AbortSignal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { AbortHandler, AbortSignal as IAbortSignal } from "@aws-sdk/types";

export { AbortHandler, IAbortSignal };

/**
* @public
*/
export class AbortSignal implements IAbortSignal {
public onabort: AbortHandler | null = null;
private _aborted = false;
Expand Down
7 changes: 7 additions & 0 deletions packages/abort-controller/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/**
* This implementation was added as Node.js didn't support AbortController prior to 15.x
* Use native implementation in browsers or Node.js \>=15.4.0.
*
* @deprecated Use standard implementations in [Browsers](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) and [Node.js](https://nodejs.org/docs/latest/api/globals.html#class-abortcontroller)
* @packageDocumentation
*/
export * from "./AbortController";
export * from "./AbortSignal";

0 comments on commit 8874468

Please sign in to comment.