⚡ 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(), and when() for async filtering
  • sthen() for sequential chaining
  • else() for fallback handling (including async error recovery)
  • match() for parallel evaluation
  • each() for async Cartesian mapping
  • self() 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 data
  • What  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

Popular posts from this blog

✨ Bridging Natural Language and Code

๐Ÿงฑ v0.0.0-dev.1

⚡ Early vs. Late Restriction