Skip to content

Commit

Permalink
fix: remove broken prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
ForbesLindesay committed Oct 3, 2024
1 parent ccec382 commit 89802e4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ yarn add then-retry
## Usage

```js
import retry, {withRetry} from 'then-retry';
import retry, { withRetry } from "then-retry";

// to retry a one of operation
await retry(() => someAsyncOp('hello world'));
await retry(() => someAsyncOp("hello world"));

// to retry every call of a given function
const someRetriedOp = withRetry(someAsyncOp);
await someRetriedOp('hello world');
await someRetriedOp("hello world");
```

The following options can be passed as a second arg to either `retry` or `withRetry`:
Expand Down
1 change: 0 additions & 1 deletion prettier.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function retry<T>(
{
shouldRetry = defaultShouldRetry,
retryDelay = defaultRetryDelay,
}: Options = {},
}: Options = {}
): Promise<T> {
let failedAttempts = 0;
while (true) {
Expand All @@ -38,7 +38,7 @@ export default async function retry<T>(

export function withRetry<TArgs extends any[], TResult>(
fn: (...args: TArgs) => Promise<TResult>,
options: Options = {},
options: Options = {}
): (...args: TArgs) => Promise<TResult> {
return async (...args) => {
return retry(() => fn(...args), options);
Expand Down

0 comments on commit 89802e4

Please sign in to comment.