UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,460 lines (1,459 loc) 93.7 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "OuterSubscriber", "range": [ 9, 24 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 24 } } }, "imported": { "type": "Identifier", "name": "OuterSubscriber", "range": [ 9, 24 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 24 } } }, "range": [ 9, 24 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 24 } } } ], "source": { "type": "Literal", "value": "../OuterSubscriber", "raw": "'../OuterSubscriber'", "range": [ 32, 52 ], "loc": { "start": { "line": 1, "column": 32 }, "end": { "line": 1, "column": 52 } } }, "range": [ 0, 53 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 53 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "subscribeToResult", "range": [ 63, 80 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 26 } } }, "imported": { "type": "Identifier", "name": "subscribeToResult", "range": [ 63, 80 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 26 } } }, "range": [ 63, 80 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 26 } } } ], "source": { "type": "Literal", "value": "../util/subscribeToResult", "raw": "'../util/subscribeToResult'", "range": [ 88, 115 ], "loc": { "start": { "line": 2, "column": 34 }, "end": { "line": 2, "column": 61 } } }, "range": [ 54, 116 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 62 } }, "trailingComments": [ { "type": "Block", "value": "*\n * Emits the values emitted by the source Observable until a `notifier`\n * Observable emits a value.\n *\n * <span class=\"informal\">Lets values pass until a second Observable,\n * `notifier`, emits something. Then, it completes.</span>\n *\n * <img src=\"./img/takeUntil.png\" width=\"100%\">\n *\n * `takeUntil` subscribes and begins mirroring the source Observable. It also\n * monitors a second Observable, `notifier` that you provide. If the `notifier`\n * emits a value or a complete notification, the output Observable stops\n * mirroring the source Observable and completes.\n *\n * @example <caption>Tick every second until the first click happens</caption>\n * var interval = Rx.Observable.interval(1000);\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = interval.takeUntil(clicks);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link take}\n * @see {@link takeLast}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @param {Observable} notifier The Observable whose first emitted value will\n * cause the output Observable of `takeUntil` to stop emitting values from the\n * source Observable.\n * @return {Observable<T>} An Observable that emits the values from the source\n * Observable until such time as `notifier` emits its first value.\n * @method takeUntil\n * @owner Observable\n ", "range": [ 117, 1434 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 35, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "takeUntil", "range": [ 1451, 1460 ], "loc": { "start": { "line": 36, "column": 16 }, "end": { "line": 36, "column": 25 } } }, "params": [ { "type": "Identifier", "name": "notifier", "range": [ 1461, 1469 ], "loc": { "start": { "line": 36, "column": 26 }, "end": { "line": 36, "column": 34 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1484, 1488 ], "loc": { "start": { "line": 37, "column": 11 }, "end": { "line": 37, "column": 15 } } }, "property": { "type": "Identifier", "name": "lift", "range": [ 1489, 1493 ], "loc": { "start": { "line": 37, "column": 16 }, "end": { "line": 37, "column": 20 } } }, "range": [ 1484, 1493 ], "loc": { "start": { "line": 37, "column": 11 }, "end": { "line": 37, "column": 20 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "TakeUntilOperator", "range": [ 1498, 1515 ], "loc": { "start": { "line": 37, "column": 25 }, "end": { "line": 37, "column": 42 } } }, "arguments": [ { "type": "Identifier", "name": "notifier", "range": [ 1516, 1524 ], "loc": { "start": { "line": 37, "column": 43 }, "end": { "line": 37, "column": 51 } } } ], "range": [ 1494, 1525 ], "loc": { "start": { "line": 37, "column": 21 }, "end": { "line": 37, "column": 52 } } } ], "range": [ 1484, 1526 ], "loc": { "start": { "line": 37, "column": 11 }, "end": { "line": 37, "column": 53 } } }, "range": [ 1477, 1527 ], "loc": { "start": { "line": 37, "column": 4 }, "end": { "line": 37, "column": 54 } } } ], "range": [ 1471, 1529 ], "loc": { "start": { "line": 36, "column": 36 }, "end": { "line": 38, "column": 1 } } }, "generator": false, "expression": false, "range": [ 1442, 1529 ], "loc": { "start": { "line": 36, "column": 7 }, "end": { "line": 38, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Emits the values emitted by the source Observable until a `notifier`\n * Observable emits a value.\n *\n * <span class=\"informal\">Lets values pass until a second Observable,\n * `notifier`, emits something. Then, it completes.</span>\n *\n * <img src=\"./img/takeUntil.png\" width=\"100%\">\n *\n * `takeUntil` subscribes and begins mirroring the source Observable. It also\n * monitors a second Observable, `notifier` that you provide. If the `notifier`\n * emits a value or a complete notification, the output Observable stops\n * mirroring the source Observable and completes.\n *\n * @example <caption>Tick every second until the first click happens</caption>\n * var interval = Rx.Observable.interval(1000);\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = interval.takeUntil(clicks);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link take}\n * @see {@link takeLast}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @param {Observable} notifier The Observable whose first emitted value will\n * cause the output Observable of `takeUntil` to stop emitting values from the\n * source Observable.\n * @return {Observable<T>} An Observable that emits the values from the source\n * Observable until such time as `notifier` emits its first value.\n * @method takeUntil\n * @owner Observable\n ", "range": [ 117, 1434 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 35, "column": 3 } } } ], "trailingComments": [] }, "specifiers": [], "source": null, "range": [ 1435, 1529 ], "loc": { "start": { "line": 36, "column": 0 }, "end": { "line": 38, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Emits the values emitted by the source Observable until a `notifier`\n * Observable emits a value.\n *\n * <span class=\"informal\">Lets values pass until a second Observable,\n * `notifier`, emits something. Then, it completes.</span>\n *\n * <img src=\"./img/takeUntil.png\" width=\"100%\">\n *\n * `takeUntil` subscribes and begins mirroring the source Observable. It also\n * monitors a second Observable, `notifier` that you provide. If the `notifier`\n * emits a value or a complete notification, the output Observable stops\n * mirroring the source Observable and completes.\n *\n * @example <caption>Tick every second until the first click happens</caption>\n * var interval = Rx.Observable.interval(1000);\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = interval.takeUntil(clicks);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link take}\n * @see {@link takeLast}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @param {Observable} notifier The Observable whose first emitted value will\n * cause the output Observable of `takeUntil` to stop emitting values from the\n * source Observable.\n * @return {Observable<T>} An Observable that emits the values from the source\n * Observable until such time as `notifier` emits its first value.\n * @method takeUntil\n * @owner Observable\n ", "range": [ 117, 1434 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 35, "column": 3 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "TakeUntilOperator", "range": [ 1534, 1551 ], "loc": { "start": { "line": 39, "column": 4 }, "end": { "line": 39, "column": 21 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "TakeUntilOperator", "range": [ 1582, 1599 ], "loc": { "start": { "line": 40, "column": 13 }, "end": { "line": 40, "column": 30 } } }, "params": [ { "type": "Identifier", "name": "notifier", "range": [ 1600, 1608 ], "loc": { "start": { "line": 40, "column": 31 }, "end": { "line": 40, "column": 39 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1620, 1624 ], "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 12 } } }, "property": { "type": "Identifier", "name": "notifier", "range": [ 1625, 1633 ], "loc": { "start": { "line": 41, "column": 13 }, "end": { "line": 41, "column": 21 } } }, "range": [ 1620, 1633 ], "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 21 } } }, "right": { "type": "Identifier", "name": "notifier", "range": [ 1636, 1644 ], "loc": { "start": { "line": 41, "column": 24 }, "end": { "line": 41, "column": 32 } } }, "range": [ 1620, 1644 ], "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 32 } } }, "range": [ 1620, 1645 ], "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 33 } } } ], "range": [ 1610, 1651 ], "loc": { "start": { "line": 40, "column": 41 }, "end": { "line": 42, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1573, 1651 ], "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 42, "column": 5 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "TakeUntilOperator", "range": [ 1656, 1673 ], "loc": { "start": { "line": 43, "column": 4 }, "end": { "line": 43, "column": 21 } } }, "property": { "type": "Identifier", "name": "prototype", "range": [ 1674, 1683 ], "loc": { "start": { "line": 43, "column": 22 }, "end": { "line": 43, "column": 31 } } }, "range": [ 1656, 1683 ], "loc": { "start": { "line": 43, "column": 4 }, "end": { "line": 43, "column": 31 } } }, "property": { "type": "Identifier", "name": "call", "range": [ 1684, 1688 ], "loc": { "start": { "line": 43, "column": 32 }, "end": { "line": 43, "column": 36 } } }, "range": [ 1656, 1688 ], "loc": { "start": { "line": 43, "column": 4 }, "end": { "line": 43, "column": 36 } } }, "right": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "subscriber", "range": [ 1701, 1711 ], "loc": { "start": { "line": 43, "column": 49 }, "end": { "line": 43, "column": 59 } } }, { "type": "Identifier", "name": "source", "range": [ 1713, 1719 ], "loc": { "start": { "line": 43, "column": 61 }, "end": { "line": 43, "column": 67 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "source", "range": [ 1738, 1744 ], "loc": { "start": { "line": 44, "column": 15 }, "end": { "line": 44, "column": 21 } } }, "property": { "type": "Identifier", "name": "_subscribe", "range": [ 1745, 1755 ], "loc": { "start": { "line": 44, "column": 22 }, "end": { "line": 44, "column": 32 } } }, "range": [ 1738, 1755 ], "loc": { "start": { "line": 44, "column": 15 }, "end": { "line": 44, "column": 32 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "TakeUntilSubscriber", "range": [ 1760, 1779 ], "loc": { "start": { "line": 44, "column": 37 }, "end": { "line": 44, "column": 56 } } }, "arguments": [ { "type": "Identifier", "name": "subscriber", "range": [ 1780, 1790 ], "loc": { "start": { "line": 44, "column": 57 }, "end": { "line": 44, "column": 67 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1792, 1796 ], "loc": { "start": { "line": 44, "column": 69 }, "end": { "line": 44, "column": 73 } } }, "property": { "type": "Identifier", "name": "notifier", "range": [ 1797, 1805 ], "loc": { "start": { "line": 44, "column": 74 }, "end": { "line": 44, "column": 82 } } }, "range": [ 1792, 1805 ], "loc": { "start": { "line": 44, "column": 69 }, "end": { "line": 44, "column": 82 } } } ], "range": [ 1756, 1806 ], "loc": { "start": { "line": 44, "column": 33 }, "end": { "line": 44, "column": 83 } } } ], "range": [ 1738, 1807 ], "loc": { "start": { "line": 44, "column": 15 }, "end": { "line": 44, "column": 84 } } }, "range": [ 1731, 1808 ], "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 85 } } } ], "range": [ 1721, 1814 ], "loc": { "start": { "line": 43, "column": 69 }, "end": { "line": 45, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1691, 1814 ], "loc": { "start": { "line": 43, "column": 39 }, "end": { "line": 45, "column": 5 } } }, "range": [ 1656, 1814 ], "loc": { "start": { "line": 43, "column": 4 }, "end": { "line": 45, "column": 5 } } }, "range": [ 1656, 1815 ], "loc": { "start": { "line": 43, "column": 4 }, "end": { "line": 45, "column": 6 } } }, { "type": "ReturnStatement", "argument": { "type": "Identifier", "name": "TakeUntilOperator", "range": [ 1827, 1844 ], "loc": { "start": { "line": 46, "column": 11 }, "end": { "line": 46, "column": 28 } } }, "range": [ 1820, 1845 ], "loc": { "start": { "line": 46, "column": 4 }, "end": { "line": 46, "column": 29 } } } ], "range": [ 1567, 1847 ], "loc": { "start": { "line": 39, "column": 37 }, "end": { "line": 47, "column": 1 } } }, "generator": false, "expression": false, "range": [ 1555, 1847 ], "loc": { "start": { "line": 39, "column": 25 }, "end": { "line": 47, "column": 1 } } }, "arguments": [], "range": [ 1555, 1849 ], "loc": { "start": { "line": 39, "column": 25 }, "end": { "line": 47, "column": 3 } } }, "range": [ 1534, 1850 ], "loc": { "start": { "line": 39, "column": 4 }, "end": { "line": 47, "column": 4 } } } ], "kind": "var", "range": [ 1530, 1851 ], "loc": { "start": { "line": 39, "column": 0 }, "end": { "line": 47, "column": 5 } }, "trailingComments": [ { "type": "Block", "value": "*\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n ", "range": [ 1852, 1943 ], "loc": { "start": { "line": 48, "column": 0 }, "end": { "line": 52, "column": 3 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "TakeUntilSubscriber", "range": [ 1948, 1967 ], "loc": { "start": { "line": 53, "column": 4 }, "end": { "line": 53, "column": 23 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "_super", "range": [ 1981, 1987 ], "loc": { "start": { "line": 53, "column": 37 }, "end": { "line": 53, "column": 43 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "__extends", "range": [ 1995, 2004 ], "loc": { "start": { "line": 54, "column": 4 }, "end": { "line": 54, "column": 13 } } }, "arguments": [ { "type": "Identifier", "name": "TakeUntilSubscriber", "range": [ 2005, 2024 ], "loc": { "start": { "line": 54, "column": 14 }, "end": { "line": 54, "column": 33 } } }, { "type": "Identifier", "name": "_super", "range": [ 2026, 2032 ], "loc": { "start": { "line": 54, "column": 35 }, "end": { "line": 54, "column": 41 } } } ], "range": [ 1995, 2033 ], "loc": { "start": { "line": 54, "column": 4 }, "end": { "line": 54, "column": 42 } } }, "range": [ 1995, 2034 ], "loc": { "start": { "line": 54, "column": 4 }, "end": { "line": 54, "column": 43 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "TakeUntilSubscriber", "range": [ 2048, 2067 ], "loc": { "start": { "line": 55, "column": 13 }, "end": { "line": 55, "column": 32 } } }, "params": [ { "type": "Identifier", "name": "destination", "range": [ 2068, 2079 ], "loc": { "start": { "line": 55, "column": 33 }, "end": { "line": 55, "column": 44 } } }, { "type": "Identifier", "name": "notifier", "range": [ 2081, 2089 ], "loc": { "start": { "line": 55, "column": 46 }, "end": { "line": 55, "column": 54 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "_super", "range": [ 2101, 2107 ], "loc": { "start": { "line": 56, "column": 8 }, "end": { "line": 56, "column": 14