UNPKG

@xailabs/altx

Version:

Flux flavor based on alt.js

1,388 lines (1,387 loc) 808 kB
{ "type": "File", "start": 0, "end": 5486, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 156, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 5486, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 156, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 34, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 34 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 16, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 16 } }, "local": { "type": "Identifier", "start": 7, "end": 16, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 16 }, "identifierName": "Immutable" }, "name": "Immutable" } } ], "source": { "type": "StringLiteral", "start": 22, "end": 33, "loc": { "start": { "line": 1, "column": 22 }, "end": { "line": 1, "column": 33 } }, "extra": { "rawValue": "immutable", "raw": "'immutable'" }, "value": "immutable" } }, { "type": "ImportDeclaration", "start": 36, "end": 74, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 38 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 43, "end": 54, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 18 } }, "local": { "type": "Identifier", "start": 43, "end": 54, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 18 }, "identifierName": "transmitter" }, "name": "transmitter" } } ], "source": { "type": "StringLiteral", "start": 60, "end": 73, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 37 } }, "extra": { "rawValue": "transmitter", "raw": "'transmitter'" }, "value": "transmitter" } }, { "type": "VariableDeclaration", "start": 78, "end": 106, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 28 } }, "declarations": [ { "type": "VariableDeclarator", "start": 84, "end": 105, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 27 } }, "id": { "type": "Identifier", "start": 84, "end": 89, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 11 }, "identifierName": "reset" }, "name": "reset" }, "init": { "type": "CallExpression", "start": 92, "end": 105, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 27 } }, "callee": { "type": "Identifier", "start": 92, "end": 103, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 25 }, "identifierName": "transmitter" }, "name": "transmitter" }, "arguments": [] } } ], "kind": "const" }, { "type": "ExportNamedDeclaration", "start": 108, "end": 164, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 7, "column": 1 } }, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", "start": 115, "end": 164, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 7, "column": 1 } }, "id": { "type": "Identifier", "start": 124, "end": 135, "loc": { "start": { "line": 5, "column": 16 }, "end": { "line": 5, "column": 27 }, "identifierName": "resetStores" }, "name": "resetStores" }, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 138, "end": 164, "loc": { "start": { "line": 5, "column": 30 }, "end": { "line": 7, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 145, "end": 161, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 20 } }, "expression": { "type": "CallExpression", "start": 145, "end": 160, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 19 } }, "callee": { "type": "MemberExpression", "start": 145, "end": 158, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 17 } }, "object": { "type": "Identifier", "start": 145, "end": 150, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 9 }, "identifierName": "reset" }, "name": "reset" }, "property": { "type": "Identifier", "start": 151, "end": 158, "loc": { "start": { "line": 6, "column": 10 }, "end": { "line": 6, "column": 17 }, "identifierName": "publish" }, "name": "publish" }, "computed": false }, "arguments": [] } } ], "directives": [] }, "leadingComments": [], "trailingComments": [] } }, { "type": "ExportDefaultDeclaration", "start": 170, "end": 5482, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 154, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 185, "end": 5482, "loc": { "start": { "line": 10, "column": 15 }, "end": { "line": 154, "column": 1 } }, "id": { "type": "Identifier", "start": 191, "end": 205, "loc": { "start": { "line": 10, "column": 21 }, "end": { "line": 10, "column": 35 }, "identifierName": "ImmutableStore" }, "name": "ImmutableStore" }, "superClass": null, "body": { "type": "ClassBody", "start": 206, "end": 5482, "loc": { "start": { "line": 10, "column": 36 }, "end": { "line": 154, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 213, "end": 765, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 27, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 213, "end": 224, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 15 }, "identifierName": "constructor" }, "name": "constructor" }, "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 225, "end": 236, "loc": { "start": { "line": 11, "column": 16 }, "end": { "line": 11, "column": 27 }, "identifierName": "initialData" }, "name": "initialData" } ], "body": { "type": "BlockStatement", "start": 238, "end": 765, "loc": { "start": { "line": 11, "column": 29 }, "end": { "line": 27, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 249, "end": 273, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 32 } }, "expression": { "type": "AssignmentExpression", "start": 249, "end": 272, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 31 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 249, "end": 262, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 21 } }, "object": { "type": "ThisExpression", "start": 249, "end": 253, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 12 } } }, "property": { "type": "Identifier", "start": 254, "end": 262, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 21 }, "identifierName": "listName" }, "name": "listName" }, "computed": false }, "right": { "type": "StringLiteral", "start": 265, "end": 272, "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 31 } }, "extra": { "rawValue": "items", "raw": "'items'" }, "value": "items" } } }, { "type": "ExpressionStatement", "start": 283, "end": 473, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 18, "column": 11 } }, "expression": { "type": "CallExpression", "start": 283, "end": 472, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 18, "column": 10 } }, "callee": { "type": "MemberExpression", "start": 283, "end": 307, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 32 } }, "object": { "type": "ThisExpression", "start": 283, "end": 287, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 12 } } }, "property": { "type": "Identifier", "start": 288, "end": 307, "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 32 }, "identifierName": "exportPublicMethods" }, "name": "exportPublicMethods" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 308, "end": 471, "loc": { "start": { "line": 13, "column": 33 }, "end": { "line": 18, "column": 9 } }, "properties": [ { "type": "ObjectProperty", "start": 323, "end": 352, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 41 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 323, "end": 334, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 23 }, "identifierName": "getItemById" }, "name": "getItemById" }, "value": { "type": "MemberExpression", "start": 336, "end": 352, "loc": { "start": { "line": 14, "column": 25 }, "end": { "line": 14, "column": 41 } }, "object": { "type": "ThisExpression", "start": 336, "end": 340, "loc": { "start": { "line": 14, "column": 25 }, "end": { "line": 14, "column": 29 } } }, "property": { "type": "Identifier", "start": 341, "end": 352, "loc": { "start": { "line": 14, "column": 30 }, "end": { "line": 14, "column": 41 }, "identifierName": "getItemById" }, "name": "getItemById" }, "computed": false } }, { "type": "ObjectProperty", "start": 367, "end": 398, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 43 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 367, "end": 379, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 24 }, "identifierName": "getIndexById" }, "name": "getIndexById" }, "value": { "type": "MemberExpression", "start": 381, "end": 398, "loc": { "start": { "line": 15, "column": 26 }, "end": { "line": 15, "column": 43 } }, "object": { "type": "ThisExpression", "start": 381, "end": 385, "loc": { "start": { "line": 15, "column": 26 }, "end": { "line": 15, "column": 30 } } }, "property": { "type": "Identifier", "start": 386, "end": 398, "loc": { "start": { "line": 15, "column": 31 }, "end": { "line": 15, "column": 43 }, "identifierName": "getIndexById" }, "name": "getIndexById" }, "computed": false } }, { "type": "ObjectProperty", "start": 413, "end": 428, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 27 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 413, "end": 417, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 16 }, "identifierName": "find" }, "name": "find" }, "value": { "type": "MemberExpression", "start": 419, "end": 428, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 16, "column": 27 } }, "object": { "type": "ThisExpression", "start": 419, "end": 423, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 16, "column": 22 } } }, "property": { "type": "Identifier", "start": 424, "end": 428, "loc": { "start": { "line": 16, "column": 23 }, "end": { "line": 16, "column": 27 }, "identifierName": "find" }, "name": "find" }, "computed": false } }, { "type": "ObjectProperty", "start": 443, "end": 460, "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 29 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 443, "end": 448, "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 17 }, "identifierName": "reset" }, "name": "reset" }, "value": { "type": "MemberExpression", "start": 450, "end": 460, "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 29 } }, "object": { "type": "ThisExpression", "start": 450, "end": 454, "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 23 } } }, "property": { "type": "Identifier", "start": 455, "end": 460, "loc": { "start": { "line": 17, "column": 24 }, "end": { "line": 17, "column": 29 }, "identifierName": "reset" }, "name": "reset" }, "computed": false } } ] } ] } }, { "type": "IfStatement", "start": 483, "end": 549, "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 21, "column": 9 } }, "test": { "type": "Identifier", "start": 487, "end": 498, "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 19, "column": 23 }, "identifierName": "initialData" }, "name": "initialData" }, "consequent": { "type": "BlockStatement", "start": 500, "end": 549, "loc": { "start": { "line": 19, "column": 25 }, "end": { "line": 21, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 515, "end": 538, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 35 } }, "expression": { "type": "CallExpression", "start": 515, "end": 537, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 34 } }, "callee": { "type": "MemberExpression", "start": 515, "end": 524, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 21 } }, "object": { "type": "ThisExpression", "start": 515, "end": 519, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 16 } } }, "property": { "type": "Identifier", "start": 520, "end": 524, "loc": { "start": { "line": 20, "column": 17 }, "end": { "line": 20, "column": 21 }, "identifierName": "init" }, "name": "init" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 525, "end": 536, "loc": { "start": { "line": 20, "column": 22 }, "end": { "line": 20, "column": 33 }, "identifierName": "initialData" }, "name": "initialData" } ] } } ], "directives": [] }, "alternate": null }, { "type": "ExpressionStatement", "start": 559, "end": 758, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 26, "column": 11 } }, "expression": { "type": "CallExpression", "start": 559, "end": 757, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 26, "column": 10 } }, "callee": { "type": "MemberExpression", "start": 559, "end": 574, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 22, "column": 23 } }, "object": { "type": "Identifier", "start": 559, "end": 564, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 22, "column": 13 }, "identifierName": "reset" }, "name": "reset" }, "property": { "type": "Identifier", "start": 565, "end": 574, "loc": { "start": { "line": 22, "column": 14 }, "end": { "line": 22, "column": 23 }, "identifierName": "subscribe" }, "name": "subscribe" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 575, "end": 756, "loc": { "start": { "line": 22, "column": 24 }, "end": { "line": 26, "column": 9 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 581, "end": 756, "loc": { "start": { "line": 22, "column": 30 }, "end": { "line": 26, "column": 9 } }, "body": [ { "type": "VariableDeclaration", "start": 596, "end": 632, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 48 } }, "declarations": [ { "type": "VariableDeclarator", "start": 602, "end": 631, "loc": { "start": { "line": 23, "column": 18 }, "end": { "line": 23, "column": 47 } }, "id": { "type": "Identifier", "start": 602, "end": 606, "loc": { "start": { "line": 23, "column": 18 }, "end": { "line": 23, "column": 22 }, "identifierName": "data" }, "name": "data" }, "init": { "type": "LogicalExpression", "start": 609, "end": 631, "loc": { "start": { "line": 23, "column": 25 }, "end": { "line": 23, "column": 47 } },