UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,242 lines (1,241 loc) 87.9 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "Observable", "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } }, "imported": { "type": "Identifier", "name": "Observable", "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } }, "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } } ], "source": { "type": "Literal", "value": "../Observable", "raw": "'../Observable'", "range": [ 27, 42 ], "loc": { "start": { "line": 1, "column": 27 }, "end": { "line": 1, "column": 42 } } }, "range": [ 0, 43 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 43 } }, "trailingComments": [ { "type": "Block", "value": "*\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n ", "range": [ 44, 138 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 6, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "EmptyObservable", "range": [ 150, 165 ], "loc": { "start": { "line": 7, "column": 11 }, "end": { "line": 7, "column": 26 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "_super", "range": [ 179, 185 ], "loc": { "start": { "line": 7, "column": 40 }, "end": { "line": 7, "column": 46 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "__extends", "range": [ 193, 202 ], "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 13 } } }, "arguments": [ { "type": "Identifier", "name": "EmptyObservable", "range": [ 203, 218 ], "loc": { "start": { "line": 8, "column": 14 }, "end": { "line": 8, "column": 29 } } }, { "type": "Identifier", "name": "_super", "range": [ 220, 226 ], "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 8, "column": 37 } } } ], "range": [ 193, 227 ], "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 38 } } }, "range": [ 193, 228 ], "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 39 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "EmptyObservable", "range": [ 242, 257 ], "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 28 } } }, "params": [ { "type": "Identifier", "name": "scheduler", "range": [ 258, 267 ], "loc": { "start": { "line": 9, "column": 29 }, "end": { "line": 9, "column": 38 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "_super", "range": [ 279, 285 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 14 } } }, "property": { "type": "Identifier", "name": "call", "range": [ 286, 290 ], "loc": { "start": { "line": 10, "column": 15 }, "end": { "line": 10, "column": 19 } } }, "range": [ 279, 290 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 19 } } }, "arguments": [ { "type": "ThisExpression", "range": [ 291, 295 ], "loc": { "start": { "line": 10, "column": 20 }, "end": { "line": 10, "column": 24 } } } ], "range": [ 279, 296 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 25 } } }, "range": [ 279, 297 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 26 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 306, 310 ], "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 12 } } }, "property": { "type": "Identifier", "name": "scheduler", "range": [ 311, 320 ], "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 22 } } }, "range": [ 306, 320 ], "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 22 } } }, "right": { "type": "Identifier", "name": "scheduler", "range": [ 323, 332 ], "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 34 } } }, "range": [ 306, 332 ], "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 34 } } }, "range": [ 306, 333 ], "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 35 } } } ], "range": [ 269, 339 ], "loc": { "start": { "line": 9, "column": 40 }, "end": { "line": 12, "column": 5 } } }, "generator": false, "expression": false, "range": [ 233, 339 ], "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 12, "column": 5 } }, "trailingComments": [ { "type": "Block", "value": "*\n * Creates an Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * <span class=\"informal\">Just emits 'complete', and nothing else.\n * </span>\n *\n * <img src=\"./img/empty.png\" width=\"100%\">\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the complete notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * @example <caption>Emit the number 7, then complete.</caption>\n * var result = Rx.Observable.empty().startWith(7);\n * result.subscribe(x => console.log(x));\n *\n * @example <caption>Map and flatten only odd numbers to the sequence 'a', 'b', 'c'</caption>\n * var interval = Rx.Observable.interval(1000);\n * var result = interval.mergeMap(x =>\n * x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()\n * );\n * result.subscribe(x => console.log(x));\n *\n * @see {@link create}\n * @see {@link never}\n * @see {@link of}\n * @see {@link throw}\n *\n * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling\n * the emission of the complete notification.\n * @return {Observable} An \"empty\" Observable: emits only the complete\n * notification.\n * @static true\n * @name empty\n * @owner Observable\n ", "range": [ 344, 1760 ], "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 49, "column": 7 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "EmptyObservable", "range": [ 1765, 1780 ], "loc": { "start": { "line": 50, "column": 4 }, "end": { "line": 50, "column": 19 } } }, "property": { "type": "Identifier", "name": "create", "range": [ 1781, 1787 ], "loc": { "start": { "line": 50, "column": 20 }, "end": { "line": 50, "column": 26 } } }, "range": [ 1765, 1787 ], "loc": { "start": { "line": 50, "column": 4 }, "end": { "line": 50, "column": 26 } } }, "right": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "scheduler", "range": [ 1800, 1809 ], "loc": { "start": { "line": 50, "column": 39 }, "end": { "line": 50, "column": 48 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "NewExpression", "callee": { "type": "Identifier", "name": "EmptyObservable", "range": [ 1832, 1847 ], "loc": { "start": { "line": 51, "column": 19 }, "end": { "line": 51, "column": 34 } } }, "arguments": [ { "type": "Identifier", "name": "scheduler", "range": [ 1848, 1857 ], "loc": { "start": { "line": 51, "column": 35 }, "end": { "line": 51, "column": 44 } } } ], "range": [ 1828, 1858 ], "loc": { "start": { "line": 51, "column": 15 }, "end": { "line": 51, "column": 45 } } }, "range": [ 1821, 1859 ], "loc": { "start": { "line": 51, "column": 8 }, "end": { "line": 51, "column": 46 } } } ], "range": [ 1811, 1865 ], "loc": { "start": { "line": 50, "column": 50 }, "end": { "line": 52, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1790, 1865 ], "loc": { "start": { "line": 50, "column": 29 }, "end": { "line": 52, "column": 5 } } }, "range": [ 1765, 1865 ], "loc": { "start": { "line": 50, "column": 4 }, "end": { "line": 52, "column": 5 } } }, "range": [ 1765, 1866 ], "loc": { "start": { "line": 50, "column": 4 }, "end": { "line": 52, "column": 6 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Creates an Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * <span class=\"informal\">Just emits 'complete', and nothing else.\n * </span>\n *\n * <img src=\"./img/empty.png\" width=\"100%\">\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the complete notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * @example <caption>Emit the number 7, then complete.</caption>\n * var result = Rx.Observable.empty().startWith(7);\n * result.subscribe(x => console.log(x));\n *\n * @example <caption>Map and flatten only odd numbers to the sequence 'a', 'b', 'c'</caption>\n * var interval = Rx.Observable.interval(1000);\n * var result = interval.mergeMap(x =>\n * x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()\n * );\n * result.subscribe(x => console.log(x));\n *\n * @see {@link create}\n * @see {@link never}\n * @see {@link of}\n * @see {@link throw}\n *\n * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling\n * the emission of the complete notification.\n * @return {Observable} An \"empty\" Observable: emits only the complete\n * notification.\n * @static true\n * @name empty\n * @owner Observable\n ", "range": [ 344, 1760 ], "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 49, "column": 7 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "EmptyObservable", "range": [ 1871, 1886 ], "loc": { "start": { "line": 53, "column": 4 }, "end": { "line": 53, "column": 19 } } }, "property": { "type": "Identifier", "name": "dispatch", "range": [ 1887, 1895 ], "loc": { "start": { "line": 53, "column": 20 }, "end": { "line": 53, "column": 28 } } }, "range": [ 1871, 1895 ], "loc": { "start": { "line": 53, "column": 4 }, "end": { "line": 53, "column": 28 } } }, "right": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "arg", "range": [ 1908, 1911 ], "loc": { "start": { "line": 53, "column": 41 }, "end": { "line": 53, "column": 44 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "subscriber", "range": [ 1927, 1937 ], "loc": { "start": { "line": 54, "column": 12 }, "end": { "line": 54, "column": 22 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "arg", "range": [ 1940, 1943 ], "loc": { "start": { "line": 54, "column": 25 }, "end": { "line": 54, "column": 28 } } }, "property": { "type": "Identifier", "name": "subscriber", "range": [ 1944, 1954 ], "loc": { "start": { "line": 54, "column": 29 }, "end": { "line": 54, "column": 39 } } }, "range": [ 1940, 1954 ], "loc": { "start": { "line": 54, "column": 25 }, "end": { "line": 54, "column": 39 } } }, "range": [ 1927, 1954 ], "loc": { "start": { "line": 54, "column": 12 }, "end": { "line": 54, "column": 39 } } } ], "kind": "var", "range": [ 1923, 1955 ], "loc": { "start": { "line": 54, "column": 8 }, "end": { "line": 54, "column": 40 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "subscriber", "range": [ 1964, 1974 ], "loc": { "start": { "line": 55, "column": 8 }, "end": { "line": 55, "column": 18 } } }, "property": { "type": "Identifier", "name": "complete", "range": [ 1975, 1983 ], "loc": { "start": { "line": 55, "column": 19 }, "end": { "line": 55, "column": 27 } } }, "range": [ 1964, 1983 ], "loc": { "start": { "line": 55, "column": 8 }, "end": { "line": 55, "column": 27 } } }, "arguments": [], "range": [ 1964, 1985 ], "loc": { "start": { "line": 55, "column": 8 }, "end": { "line": 55, "column": 29 } } }, "range": [ 1964, 1986 ], "loc": { "start": { "line": 55, "column": 8 }, "end": { "line": 55, "column": 30 } } } ], "range": [ 1913, 1992 ], "loc": { "start": { "line": 53, "column": 46 }, "end": { "line": 56, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1898, 1992 ], "loc": { "start": { "line": 53, "column": 31 }, "end": { "line": 56, "column": 5 } } }, "range": [ 1871, 1992 ], "loc": { "start": { "line": 53, "column": 4 }, "end": { "line": 56, "column": 5 } } }, "range": [ 1871, 1993 ], "loc": { "start": { "line": 53, "column": 4 }, "end": { "line": 56, "column": 6 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "EmptyObservable", "range": [ 1998, 2013 ], "loc": { "start": { "line": 57, "column": 4 }, "end": { "line": 57, "column": 19 } } }, "property": { "type": "Identifier", "name": "prototype", "range": [ 2014, 2023 ], "loc": { "start": { "line": 57, "column": 20 }, "end": { "line": 57, "column": 29 } } }, "range": [ 1998, 2023 ], "loc": { "start": { "line": 57, "column": 4 }, "end": { "line": 57, "column": 29 } } }, "property": { "type": "Identifier", "name": "_subscribe", "range": [ 2024, 2034 ], "loc": { "start": { "line": 57, "column": 30 }, "end": { "line": 57, "column": 40 } } }, "range": [ 1998, 2034 ], "loc": { "start": { "line": 57, "column": 4 },