waitUntil method
Implementation
Future<T> waitUntil(bool Function(T) predicate) async {
// short-circuit if predicate already satisfied
if (predicate($)) return $;
// otherwise, run predicate on every change
await for (T value in this.stream) {
if (predicate(value)) break;
}
return $;
}