node/rxjs/dist/esm/internal/operators/pairwise.js
raw| 1 | import { operate } from '../util/lift'; |
| 2 | import { createOperatorSubscriber } from './OperatorSubscriber'; |
| 3 | export function pairwise() { |
| 4 | return operate((source, subscriber) => { |
| 5 | let prev; |
| 6 | let hasPrev = false; |
| 7 | source.subscribe(createOperatorSubscriber(subscriber, (value) => { |
| 8 | const p = prev; |
| 9 | prev = value; |
| 10 | hasPrev && subscriber.next([p, value]); |
| 11 | hasPrev = true; |
| 12 | })); |
| 13 | }); |
| 14 | } |
| 15 | //# sourceMappingURL=pairwise.js.map |