Observer.complete()有什么作用? [英] What does observer.complete() do?
本文介绍了Observer.complete()有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 rxjs 中,observer.next()之后,observer.complete()的作用到底是什么?
In rxjs what exactly does the observer.complete() do after observer.next() ?
推荐答案
From the documentation observer.complete
notifies the Observer
that the Observable has finished sending push-based notifications.
另一方面,observer.complete
是回调函数,并且 Observable 在调用 next()后调用了此方法.最后一次,如果没有遇到任何错误.
In the other hand, observer.complete
it's a callback function and an Observable calls this method after it has called next() for the final time, if it has not encountered any errors.
这篇关于Observer.complete()有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文