Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
keller authored Oct 27, 2020
1 parent a13c54a commit ee42d7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ I originally created a function to run functions in parallel, but realized it pr
- `@param {Function} abortableFunction?` An optional function to make abortable
- `@return {Function}` wrapped function or Higher Order Function

`abortSignal()` is used to a function "abortable". It takes an abort signal and function and returns a new function that can be canceled by the via the [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) object. `abortSignal()` parameters are curried, so if now function is given, a Higher Order Function is returned that can create multiple wrapped abortable functions, with the same abortController object.
`abortSignal()` is used to a function "abortable". It takes an abort signal and function and returns a new function that can be canceled by the the [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) object. `abortSignal()` parameters are curried, so if no function is given, a Higher Order Function is returned that can create multiple wrapped abortable functions, with the same abortController object.

```js
import abortSignal from "async-fns/abortSignal";
Expand All @@ -202,7 +202,7 @@ const abortableFetchUser = abortSignal(
fetchUser
);

fetchUser(1)
abortableFetchUser(1)
.then(userInfo => {
console.log(`Hello ${userInfo.name}!`);
})
Expand Down

0 comments on commit ee42d7e

Please sign in to comment.