[RxJS] Combination operator: zip
zip Rxjs Operator combination
2023-09-14 08:59:19 时间
CombineLatest and withLatestFrom are both AND-style combination operators. In this lesson, we will learn about zip, our last AND-style combinator. It uses the n-th value of each member Observable to produce the n-th output value.
If you zip two observalbe. it will wait both n-th observalbe value emit, and combie them:
- First of foo + First of bar = first of output
- Second of foo + Second of bar = Second of output
- ...
- n-th of foo + n-th of bar = n-th of output
It will never combine: n-th of foo + (n+1)-th of bar.
var foo = Rx.Observable.of('h', 'e', 'l', 'l', 'o'); var bar = Rx.Observable.interval(400).take(5); /* (hello|) (foo) ---0---1---2---3---4| (bar) zip((x,y) => x) ---h---e---l---l---o| */ //var combined = Rx.Observable.zip(foo, bar, (x,y) => x); var combined = foo.zip(bar, (x,__)=> x); combined.subscribe( function (x) { console.log('next ' + x); }, function (err) { console.log('error ' + err); }, function () { console.log('done'); }, ); /* "next h" "next e" "next l" "next l" "next o" "done" */
相关文章
- C# zip压缩
- BAT-给文件右击菜单增加7-ZIP浏览功能
- python开发笔记之zip()函数用法详解
- Windows 安装配置 Apache .zip
- [RxJS 6] The Retry RxJs Error Handling Strategy
- mac Zip 常用命令
- [RxJS 6] The Retry RxJs Error Handling Strategy
- [Ramda] Convert a Promise.all Result to an Object with Ramda's zip and zipObj
- [CTF]zip伪加密
- 如何使用 ABAP 把多个文件打成一个 zip包 -利用 ABAP 标准工具类 cl_abap_zip
- Atitit ever note org log t99 目录 1. data1 2. Sik dsk zip mode1 3. Local exted stat2 4. Recy3 1
- Atitit zip压缩过滤器 的模块功能语实现attilax总结 1.1. 一般可以使用webserver自带的实现,。如果实现的不好或者不好配置的,或者需要精细化控制的,可以自己使用过滤器实现。
- 成功解决np.array(zip(x1, x2)).reshape(len(x1), 2) ValueError: cannot reshape array of size 1 int
- zip函数的应用
- 【Android 安全】DEX 加密 ( 代理 Application 开发 | 解压 apk 文件 | 判定是否是第一次启动 | 递归删除文件操作 | 解压 Zip 文件操作 )
- java.util.zip.ZipException: invalid LOC header (bad signature)
- 内置函数: zip 用法
- gunzip命令 unzip解压zip文件 unzip E-MTAB-8810.zip
- ci创建zip