diff options
Diffstat (limited to 'node_modules/rxjs/dist/esm/internal/operators/takeWhile.js')
| -rw-r--r-- | node_modules/rxjs/dist/esm/internal/operators/takeWhile.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/node_modules/rxjs/dist/esm/internal/operators/takeWhile.js b/node_modules/rxjs/dist/esm/internal/operators/takeWhile.js new file mode 100644 index 0000000..1884fda --- /dev/null +++ b/node_modules/rxjs/dist/esm/internal/operators/takeWhile.js @@ -0,0 +1,13 @@ +import { operate } from '../util/lift'; +import { createOperatorSubscriber } from './OperatorSubscriber'; +export function takeWhile(predicate, inclusive = false) { + return operate((source, subscriber) => { + let index = 0; + source.subscribe(createOperatorSubscriber(subscriber, (value) => { + const result = predicate(value, index++); + (result || inclusive) && subscriber.next(value); + !result && subscriber.complete(); + })); + }); +} +//# sourceMappingURL=takeWhile.js.map
\ No newline at end of file |
