Skip to content

Commit b1c0255

Browse files
committed
improve chain README; add coverage badges to repo README
1 parent fb35dd8 commit b1c0255

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.changeset/small-parrots-vanish.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"abortcontroller-chain": patch
3+
---
4+
5+
Explain _why_ chaining is useful.

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
[AbortControllers](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) and [AbortSignals](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) are awesome, but they are extremely simple building blocks.
1+
# AbortController Utilities
2+
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/kyle-johnson/abortcontroller-utils/CI)](https://github.com/kyle-johnson/abortcontroller-utils/actions)
23

3-
These utilities bring a few more _bulding blocks_ to make use of AbortController/AbortSignal a bit more concise for common use cases.
4+
[AbortControllers](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) and [AbortSignals](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) are awesome, but they are very simple building blocks.
5+
6+
These utilities bring a few more bulding blocks to make common use cases easy, such as [creating a deadline](./packages/deadline) or [chaining multiple signals into one controller](./packages/chain).
47

58
## [`abortcontroller-chain`](./packages/chain)
69
[![npm](https://img.shields.io/npm/v/abortcontroller-chain)](https://www.npmjs.com/package/abortcontroller-chain)
10+
[![Codecov](https://img.shields.io/codecov/c/github/kyle-johnson/abortcontroller-utils?flag=chain&label=coverage)](https://app.codecov.io/gh/kyle-johnson/abortcontroller-utils/)
711

812
Contect an AbortController to one or more AbortSignals.
913

1014
## [`abortcontroller-deadline`](./packages/deadline)
1115
[![npm](https://img.shields.io/npm/v/abortcontroller-deadline)](https://www.npmjs.com/package/abortcontroller-deadline)
16+
[![Codecov](https://img.shields.io/codecov/c/github/kyle-johnson/abortcontroller-utils?flag=deadline&label=coverage)](https://app.codecov.io/gh/kyle-johnson/abortcontroller-utils/)
17+
1218

1319
Easily create an AbortController which aborts after a specified amount of time (a _deadline_).

packages/chain/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![license](https://img.shields.io/npm/l/abortcontroller-chain)](https://github.com/kyle-johnson/abortcontroller-utils/blob/main/packages/chain/LICENSE)
66
[![Codecov](https://img.shields.io/codecov/c/github/kyle-johnson/abortcontroller-utils?flag=chain&label=coverage)](https://app.codecov.io/gh/kyle-johnson/abortcontroller-utils/)
77

8-
Chain multiple signals into one controller: if any of the signals aborts, the controller will be aborted.
8+
Chain multiple signals into one controller: if any of the signals aborts, the controller will be aborted. This is particularly useful since most APIs only accept a _single_ AbortSignal input ([`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/fetch), [axios](https://github.com/axios/axios#cancellation), the [AWS SDK](https://aws.amazon.com/blogs/developer/abortcontroller-in-modular-aws-sdk-for-javascript/), etc).
99

1010
Works with browsers, NodeJS (16+), and spec-compliant polyfills.
1111

0 commit comments

Comments
 (0)