Angular18 RXJS

1 RX

  全称是 Reactive Extensions,它是微软开发并维护的基于 Reactive Programming 范式实现的一套工具库集合;RX结合了观察者模式、迭代器模式、函数式编程

  RX官方文档:点击前往  

2 RXJS

  RXJS就是RX在JavaScript层面上的实现

  RXJS官方文档:点击前往

3 RXJS中解决异步事件管理的一些基本概念

  3.1 Observable

    可观察对象:表示一个可调用的未来值或者事件的集合

    官方文档:点击前往

  3.2 Observer

    观察者对象:一个回调函数集合,它知道怎么去监听被可观察对象Observable发送的值

    官方文档:点击前往

  3.3 Subscription

    订阅:表示一个可观察对象的执行,主要用于取消执行

    官方文档:点击前往

  3.4 Operators

    操作符:就是一些义函数式编程来处理可观察对象Observable

    官方文档:点击前往

  3.5 Subject

    待更新...

    官方文档:点击前往  

  3.6 Schedulers

    待更新....

    官方文档:点击前往

原文地址:https://www.cnblogs.com/NeverCtrl-C/p/8338265.html

时间: 2024-10-31 11:25:27

Angular18 RXJS的相关文章

如何理解 RxJS?RxJS的中文API和使用教程

如何理解 RxJS? 我先附上RxJS的中文教程地址方便大家去了解和使用 中文使用教程:http://rxjs-china.org/_book/ 官方中文文档:https://buctwbzs.gitbooks.io/rxjs/content/ 好啦,我们开始讲一下如何理解它 RxJS 可能对很多人而言是一个从没听说过的新名词,那么 RxJS 到底是什么呢?本文中将予以简要介绍 在 Angular 2 中,我们遇到了一个新的概念 —— RxJS. 对很多人而言,这可能是一个比较难以理解的地方.所

[RxJS] Split an RxJS observable conditionally with windowToggle

There are variants of the window operator that allow you to split RxJS observables in different ways. In this lesson we will explore the windowToggle variant and see one of its use cases in user interfaces. Let's say we want to build a new functional

学习RxJS: 导入

引子 新手们在异步编程里跌倒时,永远会有这么一个经典问题:怎么在一次异步调用里return一个结果啊? 老司机说要用回调函数,然后有条件判断的嵌套回调(回调地狱)问题来了: 老司机推荐用事件,然后异步流程里有顺序依赖: 老司机推荐用Promise,然后有顺序依赖的流程里,居然还想订阅事件: 老司机建议试试协程,谁知对方想要合并两个异步调用: -- 以上,是异步编程里要面对的一些难题,也是ReactiveX API 所致力解决的 是什么 知道有 ReactiveX 这么一回事, 源于一位巨硬铁粉的

[RxJS] Add debug method to Observable in TypeScript

Observable.prototype.debug = function(message: any) { return this.do( (next) => { if(!environment.production) { console.log(message, next); } }, (err) => { if(!environment.production) { console.error(message, err) } }, () => { if(!environment.pro

[RxJS] Use groupBy in real RxJS applications

This lesson will show when to apply groupBy in the real world. This RxJS operator is best suited when a source observable represents many data sources, e.g. an observable for multitouch events. const busObservable = Rx.Observable.of( {code: 'en-us',

[RxJS] Flatten a higher order observable with concatAll in RxJS

Besides switch and mergeAll, RxJS also provides concatAll as a flattening operator. In this lesson we will see how concatAll handles concurrent inner Observables and how it is just mergeAll(1). const clickObservable = Rx.Observable .fromEvent(documen

[RxJS] Flatten a higher order observable with mergeAll in RxJS

Among RxJS flattening operators, switch is the most commonly used operator. However, it is important to get acquainted with mergeAll, another flattening operator which allows multiple concurrent inner observables. In this lesson we will explore merge

[RxJS] Reusable multicasting with Subject factories

The way we use publish() (or multicast with an RxJS Subject) makes the shared Observable not reusable if the shared execution happens to complete or emit an error. In this lesson we will see how to use a simple Subject factory function in order to cr

[RxJS] Connection operator: multicast and connect

We have seen how Subjects are useful for sharing an execution of an RxJS observable to multiple observers. However, this technique requires some laborious setting up. In this lesson we will learn about the multicast() operator which helps solve the s