官术网_书友最值得收藏!

Observables

As we discussed earlier, in reactive programming, Observable has an underlying computation that produces values that can be consumed by a consumer (Observer). The most important thing here is that the consumer (Observer) doesn't pull values here; rather, Observable pushes the value to the consumer. So, we may say, an Observable is a push-based, composable iterator that emits its items through a series of operators to the final Observer, which finally consumes the items. Let's now break things sequentially to understand it better:

  • Observer subscribes to Observable
  • Observable starts emitting items that it has in it
  • Observer reacts to whatever item Observable emits

So, let's delve into how an Observable works through its events/methods, namely, onNext, onComplete, and onError.

主站蜘蛛池模板: 同江市| 拉孜县| 全南县| 湖北省| 景东| 兰考县| 铜梁县| 高尔夫| 五大连池市| 托克逊县| 青阳县| 安仁县| 喜德县| 永和县| 霞浦县| 民权县| 龙泉市| 沂源县| 周宁县| 鸡西市| 五莲县| 叙永县| 永宁县| 漯河市| 杭锦后旗| 喀喇沁旗| 嵩明县| 子长县| 神木县| 山东省| 新宾| 额敏县| 北海市| 灌云县| 瓮安县| 台州市| 双柏县| 闽清县| 新龙县| 潍坊市| 巴中市|