Posts

๐Ÿ‘… v0.0.0-dev.12 — Streamlining the Library

๐Ÿ‘… v0.0.0-dev.12 — Streamlining the Library We’re thrilled to announce the release of   @fizzwiz/fluent   v0.0.0-dev.12 . This prerelease focuses on   simplifying the library   by   removing the   Scope   class , reducing conceptual overhead and making the API more intuitive for developers. ๐Ÿงน Simplification & Clarity The   Scope   class has been removed entirely. Originally,   Scope   was intended to facilitate fluent definition and computation of Regular Expressions. However, Regular Expression handling appears extraneous to the current shape of the library, making the   Scope   concept unnecessary. As a result, the   Path   class, previously considered a leaf   Scope , becomes an independent class, enhancing clarity and intuitiveness. ๐Ÿ“ฆ Try it now:   npmjs This simplification confirms we are approaching a stable definition for the library. We encourage developers to experiment with the current l...

๐Ÿ”„ Infinite Cycles & Controlled Retries — AsyncWhat.self()

๐Ÿ”„ Infinite Cycles & Controlled Retries —   AsyncWhat.self() In asynchronous workflows,   retries   and   repeated executions   are a common pattern — but there’s a subtle yet powerful distinction:   whether you   await   a function or not completely changes its behavior . Understanding this allows you to implement both   controlled retries   and   infinite cycles   using the same retry logic provided by   AsyncWhat.self() . ⏳ Sequential Retries (Finite Attempts) When you want a function to   retry several times   before giving up, you typically   await   its result: const task = async ( ) => { const res = await fetch (url); if (!res. ok ) throw new Error ( "Fetch failed" ); return res. text (); } const resilient = AsyncWhat . as (task). self ( 3 , 100 , 2 ); // 3 attempts, 100ms base, exponential backoff const result = await resilient (); // <-- await is key console . l...

⚡ v0.0.0-dev.10 — Enhancing Ergonomics

⚡ v0.0.0-dev.10 — Enhancing Ergonomics We’re excited to announce the release of   @fizzwiz/fluent   v0.0.0-dev.10 . This prerelease brings several adjustments to the crucial   when()   and   self()   methods in the functional domain ( What   and   AsyncWhat ). The goal is to   mirror the behavior these methods have in the   Each   domain , improving the ergonomics, predictability, and overall fluency of the library. ⚡ Event-Aware Logic What.when()   now   lets you fluently start/stop a periodic task , just like   Each.when()   slices an iteration — even for tasks that repeat infinitely. →   Read the article ⏱ Timeout & Retry What.self(nTimes, baseDelay, factor)   now   supports infinite repetitions   of a periodic task, analogous to how   Each.self()   defines infinite iterations. The initial timeout argument has been removed in retry-mode calls for improved clarity. →   Rea...

⚡ 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...