changed<T> method

  1. @defineHook
Until<T> changed<T>(
  1. ReadableNode<T> source, {
  2. bool? detach,
})

Creates an Until hook that waits for source to change from its current value.

Example:

setup(context, props) {
  final status = useSignal('idle');
  status.value = 'loading';
  final until = useUntil.changed(status);
  // await until; // waits for status != 'loading'
  return () => Text(status.value);
}

Implementation

@defineHook
Until<T> changed<T>(
  ReadableNode<T> source, {
  bool? detach,
}) {
  return useHook(_UseUntilChangedHook<T>(source, detach: detach));
}