工作日常记录 2017-09-21
来源:互联网 发布:php 判断是否刷新页面 编辑:程序博客网 时间:2024/05/14 07:01
工作日常记录 2017-09-21
等待联调,没什么重要的任务。继续看各种文档
- RxJS的zip和昨天描述的merge类似,是对多个Observable进行合并的操作。不过不同点在于, zip是把内部绑定的多个Observable进行同步,当内部多个Observable都返回了结果的时候,把各个Obseravable的返回结果合成一个结果打到zip生成的Observable主线上面,例子如下:
import Rx from 'rxjs';import Events from 'events';// Default two Observable created by timerconst timer1 = Rx.Observable.timer(0, 8000).mapTo({ value: 'value from timer1' });const timer2 = Rx.Observable.timer(0, 10000).mapTo({ value: 'value from timer2' });// Input trigger valueconst inputE = new Events.EventEmitter();process.stdin.addListener( 'data', value => inputE.emit('input',`${input}`));const input = Rx.Observable.fromEvent(inputE, 'input');// Create a Observable that zip all the Observable aboveconst zipppedObservable = Rx.Observable.zip( timer1, timer2, input).subscribe( param =>(console.log( `result:${JSON.stringify(param)}` )));// In console, when you run the entire project// Nothing will happen, after 10 second, you enterthis is a test \n// Output will be result:[{ value: 'value from timer1' }, { value: 'value from timer2' }, 'this is a test']
阅读全文
0 0
- 工作日常记录 2017-09-21
- 工作日常记录 2017-09-20
- 工作日常记录 2017-09-22
- [日常记录]2017-12-05
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- 日常记录
- android 手机无线调试
- COCOS-2d-x学习之路(Lua)
- Vivify动画库
- JS 去重与去空值
- 在windows下静默安装JDKJRE并指定安装目录
- 工作日常记录 2017-09-21
- Fiddler
- Spring+Hibernate : 声明式事务
- tpshop 阿里云短信sdk使用和带链接短信实现
- Spring之Bean总结(二)
- Linux 系统下 MPI环境的安装与配置
- 使用Springcloud及Docker实现微服务架构
- iPhone/iPad/Android UI尺寸规范
- 重启服务器后,rabbit用户丢失问题