Last updated 2 years ago
pairwise(): Observable<Array>
Example 1:
( StackBlitz | jsBin | jsFiddle )
// RxJS v6+ import { pairwise, take } from 'rxjs/operators'; import { interval } from 'rxjs'; //Returns: [0,1], [1,2], [2,3], [3,4], [4,5] interval(1000) .pipe(pairwise(), take(5)) .subscribe(console.log);
pairwise 📰 - Official docs
📁 Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/pairwise.ts