@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,212 lines (1,211 loc) • 110 kB
JSON
{
"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": "ErrorObservable",
"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": "ErrorObservable",
"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": "ErrorObservable",
"range": [
242,
257
],
"loc": {
"start": {
"line": 9,
"column": 13
},
"end": {
"line": 9,
"column": 28
}
}
},
"params": [
{
"type": "Identifier",
"name": "error",
"range": [
258,
263
],
"loc": {
"start": {
"line": 9,
"column": 29
},
"end": {
"line": 9,
"column": 34
}
}
},
{
"type": "Identifier",
"name": "scheduler",
"range": [
265,
274
],
"loc": {
"start": {
"line": 9,
"column": 36
},
"end": {
"line": 9,
"column": 45
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "_super",
"range": [
286,
292
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 14
}
}
},
"property": {
"type": "Identifier",
"name": "call",
"range": [
293,
297
],
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 19
}
}
},
"range": [
286,
297
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 19
}
}
},
"arguments": [
{
"type": "ThisExpression",
"range": [
298,
302
],
"loc": {
"start": {
"line": 10,
"column": 20
},
"end": {
"line": 10,
"column": 24
}
}
}
],
"range": [
286,
303
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 25
}
}
},
"range": [
286,
304
],
"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": [
313,
317
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "error",
"range": [
318,
323
],
"loc": {
"start": {
"line": 11,
"column": 13
},
"end": {
"line": 11,
"column": 18
}
}
},
"range": [
313,
323
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 18
}
}
},
"right": {
"type": "Identifier",
"name": "error",
"range": [
326,
331
],
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 26
}
}
},
"range": [
313,
331
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 26
}
}
},
"range": [
313,
332
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 27
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
341,
345
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "scheduler",
"range": [
346,
355
],
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 22
}
}
},
"range": [
341,
355
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 22
}
}
},
"right": {
"type": "Identifier",
"name": "scheduler",
"range": [
358,
367
],
"loc": {
"start": {
"line": 12,
"column": 25
},
"end": {
"line": 12,
"column": 34
}
}
},
"range": [
341,
367
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 34
}
}
},
"range": [
341,
368
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 35
}
}
}
],
"range": [
276,
374
],
"loc": {
"start": {
"line": 9,
"column": 47
},
"end": {
"line": 13,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
233,
374
],
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 13,
"column": 5
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * Creates an Observable that emits no items to the Observer and immediately\n * emits an error notification.\n *\n * <span class=\"informal\">Just emits 'error', and nothing else.\n * </span>\n *\n * <img src=\"./img/throw.png\" width=\"100%\">\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the error 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 emit an error.</caption>\n * var result = Rx.Observable.throw(new Error('oops!')).startWith(7);\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * @example <caption>Map and flattens numbers to the sequence 'a', 'b', 'c', but throw an error for 13</caption>\n * var interval = Rx.Observable.interval(1000);\n * var result = interval.mergeMap(x =>\n * x === 13 ?\n * Rx.Observable.throw('Thirteens are bad') :\n * Rx.Observable.of('a', 'b', 'c')\n * );\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * @see {@link create}\n * @see {@link empty}\n * @see {@link never}\n * @see {@link of}\n *\n * @param {any} error The particular Error to pass to the error notification.\n * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling\n * the emission of the error notification.\n * @return {Observable} An error Observable: emits only the error notification\n * using the given error argument.\n * @static true\n * @name throw\n * @owner Observable\n ",
"range": [
379,
2018
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 53,
"column": 7
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "ErrorObservable",
"range": [
2023,
2038
],
"loc": {
"start": {
"line": 54,
"column": 4
},
"end": {
"line": 54,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "create",
"range": [
2039,
2045
],
"loc": {
"start": {
"line": 54,
"column": 20
},
"end": {
"line": 54,
"column": 26
}
}
},
"range": [
2023,
2045
],
"loc": {
"start": {
"line": 54,
"column": 4
},
"end": {
"line": 54,
"column": 26
}
}
},
"right": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "error",
"range": [
2058,
2063
],
"loc": {
"start": {
"line": 54,
"column": 39
},
"end": {
"line": 54,
"column": 44
}
}
},
{
"type": "Identifier",
"name": "scheduler",
"range": [
2065,
2074
],
"loc": {
"start": {
"line": 54,
"column": 46
},
"end": {
"line": 54,
"column": 55
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "ErrorObservable",
"range": [
2097,
2112
],
"loc": {
"start": {
"line": 55,
"column": 19
},
"end": {
"line": 55,
"column": 34
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "error",
"range": [
2113,
2118
],
"loc": {
"start": {
"line": 55,
"column": 35
},
"end": {
"line": 55,
"column": 40
}
}
},
{
"type": "Identifier",
"name": "scheduler",
"range": [
2120,
2129
],
"loc": {
"start": {
"line": 55,
"column": 42
},
"end": {
"line": 55,
"column": 51
}
}
}
],
"range": [
2093,
2130
],
"loc": {
"start": {
"line": 55,
"column": 15
},
"end": {
"line": 55,
"column": 52
}
}
},
"range": [
2086,
2131
],
"loc": {
"start": {
"line": 55,
"column": 8
},
"end": {
"line": 55,
"column": 53
}
}
}
],
"range": [
2076,
2137
],
"loc": {
"start": {
"line": 54,
"column": 57
},
"end": {
"line": 56,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
2048,
2137
],
"loc": {
"start": {
"line": 54,
"column": 29
},
"end": {
"line": 56,
"column": 5
}
}
},
"range": [
2023,
2137
],
"loc": {
"start": {
"line": 54,
"column": 4
},
"end": {
"line": 56,
"column": 5
}
}
},
"range": [
2023,
2138
],
"loc": {
"start": {
"line": 54,
"column": 4
},
"end": {
"line": 56,
"column": 6
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Creates an Observable that emits no items to the Observer and immediately\n * emits an error notification.\n *\n * <span class=\"informal\">Just emits 'error', and nothing else.\n * </span>\n *\n * <img src=\"./img/throw.png\" width=\"100%\">\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the error 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 emit an error.</caption>\n * var result = Rx.Observable.throw(new Error('oops!')).startWith(7);\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * @example <caption>Map and flattens numbers to the sequence 'a', 'b', 'c', but throw an error for 13</caption>\n * var interval = Rx.Observable.interval(1000);\n * var result = interval.mergeMap(x =>\n * x === 13 ?\n * Rx.Observable.throw('Thirteens are bad') :\n * Rx.Observable.of('a', 'b', 'c')\n * );\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * @see {@link create}\n * @see {@link empty}\n * @see {@link never}\n * @see {@link of}\n *\n * @param {any} error The particular Error to pass to the error notification.\n * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling\n * the emission of the error notification.\n * @return {Observable} An error Observable: emits only the error notification\n * using the given error argument.\n * @static true\n * @name throw\n * @owner Observable\n ",
"range": [
379,
2018
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 53,
"column": 7
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "ErrorObservable",
"range": [
2143,
2158
],
"loc": {
"start": {
"line": 57,
"column": 4
},
"end": {
"line": 57,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "dispatch",
"range": [
2159,
2167
],
"loc": {
"start": {
"line": 57,
"column": 20
},
"end": {
"line": 57,
"column": 28
}
}
},
"range": [
2143,
2167
],
"loc": {
"start": {
"line": 57,
"column": 4
},
"end": {
"line": 57,
"column": 28
}
}
},
"right": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "arg",
"range": [
2180,
2183
],
"loc": {
"start": {
"line": 57,
"column": 41
},
"end": {
"line": 57,
"column": 44
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "error",
"range": [
2199,
2204
],
"loc": {
"start": {
"line": 58,
"column": 12
},
"end": {
"line": 58,
"column": 17
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "arg",
"range": [
2207,
2210
],
"loc": {
"start": {
"line": 58,
"column": 20
},
"end": {
"line": 58,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "error",
"range": [
2211,
2216
],
"loc": {
"start": {
"line": 58,
"column": 24
},
"end": {
"line": 58,
"column": 29
}
}
},
"range": [
2207,
2216
],
"loc": {
"start": {
"line": 58,
"column": 20
},
"end": {
"line": 58,
"column": 29
}
}
},
"range": [
2199,
2216
],
"loc": {
"start": {
"line": 58,
"column": 12
},
"end": {
"line": 58,
"column": 29
}
}
},
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "subscriber",
"range": [
2218,
2228
],
"loc": {
"start": {
"line": 58,
"column": 31
},
"end": {
"line": 58,
"column": 41
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "arg",
"range": [
2231,
2234
],
"loc": {
"start": {
"line": 58,
"column": 44
},
"end": {
"line": 58,
"column": 47
}
}
},
"property": {
"type": "Identifier",
"name": "subscriber",
"range": [
2235,
2245
],
"loc": {
"start": {
"line": 58,
"column": 48
},
"end": {
"line": 58,
"column": 58
}
}
},
"range": [
2231,
2245
],
"loc": {
"start": {
"line": 58,
"column": 44
},