BloomEffectScope extension type

Canonical scoped namespace for declarative reactive Effect creation targeting multiple Bloom nodes.

Compile-time zero-cost abstraction wrapping multiple Bloom nodes with direct monomorphic multi-target terminal dispatch.

Sub-Functor & Invocation Pathways

targets.effect                 ((action) => ...)
 ├── .scoped                   ((scope) => ...)
 ├── .throttle                 (duration, (action) => ...)
 └── .debounce                 (duration, (action) => ...)

Mechanics & Lifecycle Characteristics

As a Dart 3 extension type (extension type const BloomEffectScope), this abstraction introduces zero runtime heap allocation overhead. Invocations dispatch directly to multi-target manifest terminals (_NaryManifestEffectTerminal, _HandledNaryManifestEffectTerminal, _NaryDebounceEffectTerminal, _NaryThrottleEffectTerminal), coordinating multiple upstream reactive nodes under a single non-propagating lifecycle terminal.

System Architectural Flow

[Source Nodes: (A, B, ...)]
              │
              ▼ (Push-Dirty Invalidation)
  [BloomEffectScope Namespace]
              │
       ┌──────┴──────────────────────────┬────────────────────────┐
       │ .call() / .scoped()             │ .throttle()            │ .debounce()
       ▼                                 ▼                        ▼
[N-ary Manifest Terminal]     [N-ary Throttle Terminal] [N-ary Debounce Terminal]
       │                                 │                        │
       └────────────────────────┬────────┴────────────────────────┘
                                ▼
                    [Execute Untracked Action]

Architectural Benefits

  1. Zero Heap Overhead: Erases entirely at compile time to static terminal constructor calls.
  2. Fluent Method-Chaining Ergonomics: Enables chaining .scoped, .throttle, and .debounce directly from tuples (e.g. (user.bloom, auth.bloom).effect) or Iterable<Bloom> collections.
  3. Multi-Dependency Edge Consolidation: Coordinates multiple upstream triggers into a single action turn without intermediate relay allocations.

Examples

final user = blooming('Alice');
final auth = blooming(true);

// Create a multi-target effect off a tuple:
final syncEffect = (user.bloom, auth.bloom).effect(() {
  syncProfile(untracked(user.bloom), untracked(auth.bloom));
});
on

Constructors

BloomEffectScope(Iterable<Bloom> _targets)
const

Methods

call(void action(), {bool guard()?, int? take, void onUncaughtError(Object error, StackTrace stackTrace)?}) → Effect
Defines an explicit manifest Effect attached to the scoped targets.
debounce(Duration duration, void action(), {bool guard()?, bool leading = false, bool trailing = true, int? take, void onUncaughtError(Object error, StackTrace stackTrace)?}) → Effect
Defines an explicit time-stabilized debounce Effect attached to the scoped targets.
scoped(void action(EffectScope scope), {bool guard()?, int? take, void onUncaughtError(Object error, StackTrace stackTrace)?}) → Effect
Defines an explicit scoped Effect attached to the scoped targets providing an EffectScope.
throttle(Duration duration, void action(), {bool guard()?, bool leading = true, bool trailing = true, int? take, void onUncaughtError(Object error, StackTrace stackTrace)?}) → Effect
Defines an explicit rate-limited throttle Effect attached to the scoped targets.