Memo<T> class

Memoization sugar.

Only re-evaluates builder when dependency returns a value that differs (!=) from the previous execution. Prevents expensive subtree re-evaluations when unrelated signals update.

DOM Representation

Mounts between sentinel comments <!-- bloom:memo --> and <!-- /bloom:memo -->.

final activeUserId = signal('user-1');

BloomNode userProfileView() => Div(
  children: [
    Memo(
      () => activeUserId.value,
      (id) => Div(
        className: 'profile-card',
        text: 'Loaded profile for: $id',
      ),
    ),
  ],
);
Inheritance

Constructors

Memo(T dependency(), BloomNode builder(T value))
Creates a memoized boundary descriptor with dependency and builder.
const

Properties

builder BloomNode Function(T value)
Builder that produces a descriptor tree from the evaluated dependency value.
finalinherited
builderErased BloomNode Function(Object? value)
builder, accepting an untyped Object? dependency value.
no setterinherited
dependency → T Function()
Reactive computation returning the dependency value of type T.
finalinherited
dependencyErased Object? Function()
dependency, viewed untyped as Object? Function().
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited