Posts

Showing posts from September, 2025

⚡ v0.0.0-dev.9 — Rethinking Functional Programming

⚡ v0.0.0-dev.9 — Rethinking Functional Programming We’re excited to announce the prerelease of   @fizzwiz/fluent   v0.0.0-dev.9 . This release brings key improvements to the   functional programming interfaces   What   and   AsyncWhat , making declarative workflows even more expressive and robust. 🔎 Smarter Conditions if()   and   which()   can now   throw errors   when predicates fail, enabling clearer control flow. else()   steps in to   catch these errors   and provide graceful fallbacks. ⚡ Event-Aware Logic when()   now   lets you fluently express distributed, event-driven computations   — even when multiple machines are involved. →   Read the article ⏱ Timeout & Retry self()   gains the ability to create   timeout-aware computations   and   retry logic . →   Explore how it works This prerelease continues our mission:   making functional programming in JavaScr...

⏱ Timeout & Retry Made Fluent

⏱ Timeout & Retry Made Fluent —   AsyncWhat.self() In asynchronous workflows, handling   timeouts   and   retries   is often verbose, full of   try/catch , timers, and orchestration boilerplate. The   self()   method of   AsyncWhat   provides a   declarative, fluent abstraction   for these concerns, so you can focus on   what   should happen, not   how   to wire it up. ⏳ Timeout Mode const fetchWithTimeout = AsyncWhat . as ( () => fetch (url). then ( res => res. text ())) . self ( 2000 ); // timeout after 2s await fetchWithTimeout (); self(ms)   wraps the current async computation in a   timeout guard . If the operation does not resolve within   ms   milliseconds, it rejects with   TimeoutError . Timeouts stay   explicit and visible in the chain , without cluttering the business logic. 🔁 Retry Mode Retries are often the messiest part of async logic.   s...

🧠 The Power of the when() Method

🧠 Bridging Sync and Async Domains — The Power of   when() In modern JavaScript, we often juggle   two different worlds : The   synchronous   world of values, arrays, and functions The   asynchronous   world of Promises, events, and distributed systems Bridging these domains usually means boilerplate: callbacks, event listeners, timeouts, and manual cleanup. The   when()   method provides a   unifying abstraction . It makes synchronous and asynchronous flows feel the same—expressed as   declarative, chainable logic   rather than tangled callbacks. At its core,   when()   brings two powers: Start/stop control In iterations: slice infinite/lazy sequences by event-like conditions. In workflows: start or stop tasks dynamically on external triggers. Domain promotion Iterables of promises → seamlessly promoted into async iterables of resolved values. Synchronous tasks → promoted into asynchronous workflows that respond to events...