syncToValueNotifier<T> function

ListenerDisposer syncToValueNotifier<T>(
  1. ValueNotifier<T> notifier,
  2. SingleValue<T> singleValue
)

Implementation

ListenerDisposer syncToValueNotifier<T>(
    ValueNotifier<T> notifier, SingleValue<T> singleValue) {
  final updater = () => singleValue.update(notifier.value);
  notifier.addListener(updater);
  return () => notifier.removeListener(updater);
}