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

pairwise 方法描述有问题 #9

Open
dxd1102 opened this issue Nov 11, 2019 · 0 comments
Open

pairwise 方法描述有问题 #9

dxd1102 opened this issue Nov 11, 2019 · 0 comments

Comments

@dxd1102
Copy link

dxd1102 commented Nov 11, 2019

原描述:

pairwise
函数签名: pairwise(): Observable
将前一个值和当前值作为数组发出

示例:

// RxJS v6+
import { pairwise, take } from 'rxjs/operators';
import { interval } from 'rxjs';

// 返回: [0,1], [1,2], [2,3], [3,4], [4,5]
interval(1000)
.pipe(
pairwise(),
take(5)
)
.subscribe(console.log);

输出为 [0,1], [1,2], [2,3], [3,4], [4,5]
去掉 pairwise() 方法
输出为 0,1,2,3,4
并非为描述中的: 将前一个值和当前值作为数组发出

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

No branches or pull requests

1 participant