UnaryBloomEffectScope extension type

Specialized scoped namespace for declarative reactive Effect creation targeting a single Bloom.

Compile-time zero-cost abstraction wrapping a single Bloom node with zero heap allocation and direct monomorphic unary terminal dispatch.

Sub-Functor & Invocation Pathways

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

Mechanics & Lifecycle Characteristics

As a specialized Dart 3 extension type (extension type const UnaryBloomEffectScope), this namespace bypasses intermediate collections and iterator overhead, constructing specialized unary terminals (_UnaryManifestEffectTerminal, _HandledUnaryManifestEffectTerminal, _UnaryDebounceEffectTerminal, _UnaryThrottleEffectTerminal) that directly link to the underlying source node.

System Architectural Flow

[Single Target: target.bloom]
              │
              ▼ (Push-Dirty Invalidation)
[UnaryBloomEffectScope Namespace]
              │
       ┌──────┴──────────────────────────┬────────────────────────┐
       │ .call() / .scoped()             │ .throttle()            │ .debounce()
       ▼                                 ▼                        ▼
[Unary Manifest Terminal]     [Unary Throttle Terminal] [Unary Debounce Terminal]
       │                                 │                        │
       └────────────────────────┬────────┴────────────────────────┘
                                ▼
                    [Execute Untracked Action]

Architectural Benefits

  1. Zero Heap Allocation: Directly links the single source node without allocating List<Bloom>.
  2. Monomorphic Dispatch: Specialized unary terminals yield optimal V8 and Dart AOT inlining.
  3. Fluent Ergonomics: Accessible directly off any Bloom node via target.effect.

Examples

final counter = blooming(0);
final effect = counter.bloom.effect(() {
  print('New counter value: ${untracked(counter.bloom)}');
});
on

Constructors

UnaryBloomEffectScope(Bloom _target)
const

Methods

call(void action(), {bool guard()?, int? take, void onUncaughtError(Object error, StackTrace stackTrace)?}) → Effect
Defines an explicit manifest Effect attached to this node.
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 this node.
scoped(void action(EffectScope scope), {bool guard()?, int? take, void onUncaughtError(Object error, StackTrace stackTrace)?}) → Effect
Defines an explicit scoped Effect attached to this node 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 this node.