2.1.1 • Published 5 years ago

rxjs-take-while-inclusive v2.1.1

Weekly downloads
607
License
MIT
Repository
github
Last release
5 years ago

npm version

Note: This package is no longer needed as of rxjs@6.4.0 as the operator now takes an extra parameter which when true will also emit the last value. See rxjs#4115.

TakeWhileInclusive

A takeWhile variant which also emits the value not satisfying the predicate before completing.

Example usage

import { takeWhileInclusive } from 'rxjs-take-while-inclusive';
import { interval } from 'rxjs/observable/interval';

 interval(1000).pipe(
    takeWhileInclusive(v => v < 5),
).subscribe(console.log);
// Prints: 0, 1, 2, 3, 4, 5

Emits values emitted by the source Observable so long as each value satisfies the given predicate, and then completes after the last emitted value satisfies the predicate. takeWhileInclusive subscribes and begins mirroring the source Observable. Each value emitted on the source is emitted then given to the predicate function which returns a boolean, representing a condition to be satisfied by the source values. The output Observable emits the source values until such time as the predicate returns false, at which point takeWhileInclusive stops mirroring the source Observable and completes the output Observable.

Node

This module supports CommonJS, esm5 and esm2015. To use in node see the following import.

const {takeWhileInclusive} = require('rxjs-take-while-inclusive');
2.1.1

5 years ago

2.1.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago