$computed<T> method

Computed<T> $computed<T>(
  1. T computation(), {
  2. String? debugLabel,
})

Creates a Computed signal with ultra-short syntax.

Example:

late final doubled = $computed(() => count.val * 2);

Implementation

Computed<T> $computed<T>(
  T Function() computation, {
  String? debugLabel,
}) {
  return Computed<T>(
    computation,
    debugLabel: debugLabel,
  ).bind(this);
}