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

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.

主站蜘蛛池模板: 碌曲县| 保德县| 贺州市| 银川市| 昌都县| 读书| 日喀则市| 洪雅县| 措美县| 秭归县| 金平| 右玉县| 田阳县| 澜沧| 盈江县| 东阳市| 耒阳市| 尉犁县| 朝阳县| 双峰县| 青海省| 阜康市| 永平县| 温州市| 永泰县| 鲁山县| 柳江县| 柘城县| 霞浦县| 望奎县| 砀山县| 博野县| 天祝| 武宣县| 商丘市| 紫阳县| 长宁县| 黄山市| 克拉玛依市| 来凤县| 东丰县|