computed<T> method

Computed<T> computed<T>(
  1. T compute(), {
  2. bool lazy = false,
})
inherited

Creates a memoized, glitch-free Computed signal scoped to this controller and automatically disposes its upstream subscriptions in onClose.

Set lazy to true to defer recomputation while unobserved until read.

Implementation

Computed<T> computed<T>(T Function() compute, {bool lazy = false}) {
  final signal = Computed<T>(compute, lazy: lazy);
  _syncDisposers.add(signal.dispose);
  return signal;
}