Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodyowl committed Apr 30, 2024
1 parent 9a4112e commit 25ac961
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions docs/docs/future-result.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,21 @@ The function provides a 0-based `attempt` count to the function if you need to i

```ts title="Examples"
// retry immediately after failure
Future.retry((attempt) => {
return getUserById(userId);
});
Future.retry(
(attempt) => {
return getUserById(userId);
},
{ max: 3 },
);
// Future<Result<...>>

// adding delay
Future.retry((attempt) => {
return Future.wait(attempt * 100).flatMap(() => getUserById(userId));
});
Future.retry(
(attempt) => {
return Future.wait(attempt * 100).flatMap(() => getUserById(userId));
},
{ max: 10 },
);
// Future<Result<...>>
```

Expand Down

0 comments on commit 25ac961

Please sign in to comment.