call<T> method
Creates a computed value hook that derives from reactive dependencies.
The computed value is cached and only recalculates when its dependencies change.
Parameters:
getter: Function that computes the derived valueonDebug: Optional debug callback for reactive system debugging
Returns: A Computed that automatically updates when dependencies change
Example:
setup(context, props) {
final count = useSignal(5);
final doubled = useComputed(() => count.value * 2);
final message = useComputed(() => 'Count is ${count.value}');
return () => Text('${message.value}, doubled: ${doubled.value}');
}
Implementation
Computed<T> call<T>(T Function() getter, {JoltDebugFn? onDebug}) {
return useAutoDispose(() => Computed(getter, onDebug: onDebug));
}