Boxed's Avatar

Boxed

@boxed.cool.bsky.social

essential building-blocks for functional & safe TypeScript code. makes your life easier.

11 Followers  |  0 Following  |  8 Posts  |  Joined: 01.12.2024  |  1.2175

Latest posts by boxed.cool on Bluesky

While you have a simple Future.all to run all futures in parallel (like Promise.all does), you might want to limit the concurrency at which you execute operations.

Using Future.concurrent, you can specify the maximum concurrency for your array of operations.

While you have a simple Future.all to run all futures in parallel (like Promise.all does), you might want to limit the concurrency at which you execute operations. Using Future.concurrent, you can specify the maximum concurrency for your array of operations.

Retry with maximum attempts

If getUserById outputs a Result.Ok value, the future resolves, if it outputs a Result.Error, it re-executes getUserById.

Retry with delay

The function you pass Future.retry takes an attempt parameter, which is the current number of attempts. The count starts at 0.

Retry with maximum attempts If getUserById outputs a Result.Ok value, the future resolves, if it outputs a Result.Error, it re-executes getUserById. Retry with delay The function you pass Future.retry takes an attempt parameter, which is the current number of attempts. The count starts at 0.

did you know?

maximum concurrency & retry mechanisms are directly handled in Boxed since 2.3.0

24.12.2024 14:20 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

YOU DON’T HAVE TO SUFFER

20.12.2024 23:35 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

if that happens shut the door right away and call us

20.12.2024 23:34 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0
Video thumbnail

fig. 1: impossible states when your product type could've been a sum type

20.12.2024 08:21 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

it’d require a lot of changes in the way intellisense handles these kind of things, maybe the pipeline operator will drive some work on this area

19.12.2024 20:26 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

with chaining, each value comes with its available functions as they belong in the prototype, with pipes you have to open a pipe, then import the module, then start typing

19.12.2024 20:19 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
GitHub - tc39/proposal-pipeline-operator: A proposal for adding a useful pipe operator to JavaScript. A proposal for adding a useful pipe operator to JavaScript. - tc39/proposal-pipeline-operator

yeah, pipes are good on paper, but in the current JS/TS tooling it hurts autocompletion.

(we’ll consider providing it as an alternative API if github.com/tc39/proposa... lands at some point)

19.12.2024 20:14 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Boxed: Essential building-blocks for functional & safe TypeScript code | Boxed Essential building-blocks for functional & safe TypeScript code

we now have a 😎 cool 😎 domain

boxed.cool

19.12.2024 19:41 β€” πŸ‘ 5    πŸ” 3    πŸ’¬ 1    πŸ“Œ 0