aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/dist/esm/internal/operators/takeWhile.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/rxjs/dist/esm/internal/operators/takeWhile.js')
-rw-r--r--node_modules/rxjs/dist/esm/internal/operators/takeWhile.js13
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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage