⚡ v0.0.0-dev.7 — Async What Arrives
⚡ v0.0.0-dev.7 — Async What Arrives
With v0.0.0-dev.7, Fluent takes another big step: introducing AsyncWhat
, the asynchronous counterpart to What
.
If What
gave you a fluent way to compose synchronous functions, AsyncWhat
extends the same elegance to async functions and Promises. Now you can declaratively filter, transform, and compose asynchronous computations just like you would with plain values.
❓ Why AsyncWhat
?
Think of it as the missing glue between Promises and functional programming. Behind its idea there is the same purpose driving the development of the What
class, which is discussed ๐ here.
JavaScript async functions are powerful, but they quickly turn messy when you try to compose them. AsyncWhat
solves this by wrapping async functions into chainable, lazy constructs.
๐ฏ Fluent Async Composition
AsyncWhat
gives you the same operators as What
, adapted to the async world:
if()
,which()
, andwhen()
for async filteringsthen()
for sequential chainingelse()
for fallback handling (including async error recovery)match()
for parallel evaluationeach()
for async Cartesian mappingself()
for path-based and context-aware transformations
๐ Practical Examples
For method details, practical usage, and integration with What
and other Fluent constructs, visit the ๐ AsyncWhat API. Very simple examples are discussed there. More advanced applications will be presented in dedicated posts.
๐ What’s Next?
With AsyncWhat
, the Fluent ecosystem now has parallels across both sync and async worlds:
Each
↔AsyncEach
for dataWhat
↔AsyncWhat
for functions
This symmetry means you can write your logic once, and apply it in both synchronous and asynchronous contexts.
This is just the beginning — based on the AsyncEach
and AsyncWhat
concepts, more specialized and powerful abstractions are on the way. Stay tuned! ๐
— @fizzwiz ✨
Comments
Post a Comment