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

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.

主站蜘蛛池模板: 通州市| 临清市| 德安县| 安吉县| 民县| 临西县| 离岛区| 遵化市| 伊通| 龙里县| 浦城县| 福安市| 洛宁县| 收藏| 图木舒克市| 阳高县| 都匀市| 蒲江县| 泗洪县| 禄丰县| 河池市| 汉寿县| 信丰县| 同德县| 海宁市| 江安县| 宜宾县| 涿鹿县| 镇赉县| 黄山市| 科技| 东港市| 莎车县| 淮阳县| 广汉市| 通城县| 民丰县| 烟台市| 保亭| 黑河市| 邹城市|