浏览代码

fix stream pipe

/main
Xingwei Zhu 3 年前
当前提交
33521c79
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 2
      com.unity.uiwidgets/Runtime/async/stream.cs
  2. 3
      com.unity.uiwidgets/Runtime/async/stream_pipe.cs

2
com.unity.uiwidgets/Runtime/async/stream.cs


Future<E> drain<E>(E futureValue) =>
listen(null, cancelOnError: true).asFuture<E>(futureValue);
Stream<T> take(int count) {
public Stream<T> take(int count) {
return new _TakeStream<T>(this, count);
}

3
com.unity.uiwidgets/Runtime/async/stream_pipe.cs


Action<T> onData, Action<object, string> onError, Action onDone, bool cancelOnError
)
: base(onData, onError, onDone, cancelOnError) {
this._stream = _stream;
_subscription = _stream._source
.listen(_handleData, onError: _handleError, onDone: _handleDone);
}

this, onData, onError, onDone, cancelOnError, _count);
}
void _handleData(T inputEvent, _EventSink<T> sink) {
internal override void _handleData(T inputEvent, _EventSink<T> sink) {
_StateStreamSubscription<T> subscription = (_StateStreamSubscription<T>) sink;
int count = subscription._count;
if (count > 0) {

正在加载...
取消
保存