Skip to content

Commit

Permalink
🔤 fix typedoc formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
robinpokorny committed Jul 13, 2021
1 parent d0fad00 commit aa696eb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
24 changes: 12 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A Task is a nullary function that returns a promise

#### Defined in

[index.ts:4](https://github.com/robinpokorny/promise-throttle-all/blob/62c374f/src/index.ts#L4)
[index.ts:4](https://github.com/robinpokorny/promise-throttle-all/blob/d0fad00/src/index.ts#L4)

## Functions

Expand All @@ -46,7 +46,8 @@ A Task is a nullary function that returns a promise

Run tasks with limited concurency.

**`example`** ```ts
**`example`**
```ts
const task1 = () => new Promise((resolve) => {
setTimeout(resolve, 100, 1);
});
Expand All @@ -57,11 +58,6 @@ throttleAll(1, [task1, task2])
// task2 will run after task2 finishes
// logs: `[1, 2]`
```
@param limit - Limit of tasks that run at once.
@param tasks - List of tasks to run.
@returns A promise that fulfills to an array of the results
of the input promises or rejects immediately upon any of
the input tasks rejecting.

#### Type parameters

Expand All @@ -71,15 +67,19 @@ the input tasks rejecting.

#### Parameters

| Name | Type |
| :------ | :------ |
| `limit` | `number` |
| `tasks` | [`Task`](README.md#task)<`T`\>[] |
| Name | Type | Description |
| :------ | :------ | :------ |
| `limit` | `number` | Limit of tasks that run at once. |
| `tasks` | [`Task`](README.md#task)<`T`\>[] | List of tasks to run. |

#### Returns

`Promise`<`T`[]\>

A promise that fulfills to an array of the results
of the input promises or rejects immediately upon any of
the input tasks rejecting.

#### Defined in

[index.ts:27](https://github.com/robinpokorny/promise-throttle-all/blob/62c374f/src/index.ts#L27)
[index.ts:28](https://github.com/robinpokorny/promise-throttle-all/blob/d0fad00/src/index.ts#L28)
13 changes: 7 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ const notSettled = Symbol(`not-settled`)

/**
* Run tasks with limited concurency.
* @example ```ts
* @param limit - Limit of tasks that run at once.
* @param tasks - List of tasks to run.
* @returns A promise that fulfills to an array of the results
* of the input promises or rejects immediately upon any of
* the input tasks rejecting.
* @example
* ```ts
* const task1 = () => new Promise((resolve) => {
* setTimeout(resolve, 100, 1);
* });
Expand All @@ -18,11 +24,6 @@ const notSettled = Symbol(`not-settled`)
* // task2 will run after task2 finishes
* // logs: `[1, 2]`
* ```
* @param limit - Limit of tasks that run at once.
* @param tasks - List of tasks to run.
* @returns A promise that fulfills to an array of the results
* of the input promises or rejects immediately upon any of
* the input tasks rejecting.
*/
export const throttleAll = <T>(
limit: number,
Expand Down

0 comments on commit aa696eb

Please sign in to comment.