computed<T> method
- T computation(), {
- String? debugLabel,
Creates a Computed signal and automatically binds it to this controller.
Computed values are lazily evaluated and automatically track dependencies.
Example:
late final count = signal(0);
late final doubled = computed(() => count.val * 2);
late final message = computed(() => 'Count is ${count.val}');
Implementation
Computed<T> computed<T>(
T Function() computation, {
String? debugLabel,
}) {
return Computed<T>(
computation,
debugLabel: debugLabel,
).bind(this);
}