Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive Programming: ReactiveX #159

Open
hhstore opened this issue Jun 9, 2019 · 7 comments
Open

Reactive Programming: ReactiveX #159

hhstore opened this issue Jun 9, 2019 · 7 comments

Comments

@hhstore
Copy link
Owner

hhstore commented Jun 9, 2019

related:

@hhstore
Copy link
Owner Author

hhstore commented Jun 9, 2019

ReactiveX:

使用与数组集合方式
组合操作: 异步事件流
摆脱复杂的回调地狱
提高代码可读性, 降低出错性.

image

Rx(.NET): 微软

  • http://wiki.jikexueyuan.com/project/rxjava//chapter1/microsoft_reactive_extensions.html
  • 函数响应式编程是一个来自90年代后期受微软的一名计算机科学家Erik Meijer启发的思想,用来设计和开发微软的Rx库。
  • Rx 是微软.NET的一个响应式扩展。
  • Rx借助可观测的序列提供一种简单的方式来创建异步的,基于事件驱动的程序。
  • 开发者可以使用Observables模拟异步数据流,使用LINQ语法查询Observables,并且很容易管理调度器的并发。

RxJava: Netflix开源

RxGo:

RxJs:

项目:

awesome:

教程:

@hhstore
Copy link
Owner Author

hhstore commented Jun 9, 2019

观察者模式:

@hhstore
Copy link
Owner Author

hhstore commented Jun 9, 2019

RxGo:

v2 版本分支:

教程:

@hhstore
Copy link
Owner Author

hhstore commented Jun 9, 2019

@hhstore hhstore changed the title Reactive Programming Reactive Programming: ReactiveX Jun 9, 2019
@hhstore
Copy link
Owner Author

hhstore commented Jun 9, 2019

ReactiveX 理念:

image

可观测的(observable):

image

操作符(operators):

image

image

image

image

image

@hhstore
Copy link
Owner Author

hhstore commented Jun 10, 2019

tips:

  • map适用于一对一转换,当然也可以配合flatmap进行适用
  • flatmap适用于一对多多对多的场景

distinct(): 去重复

filter():

merge:

@hhstore
Copy link
Owner Author

hhstore commented Jun 10, 2019

示例代码:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant