You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
6.0 KiB

{"ast":null,"code":"function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nimport { log } from \"../utils/log.js\";\n\nvar WebSocketClient = /*#__PURE__*/function () {\n /**\n * @param {string} url\n */\n function WebSocketClient(url) {\n _classCallCheck(this, WebSocketClient);\n\n this.client = new WebSocket(url);\n\n this.client.onerror = function (error) {\n log.error(error);\n };\n }\n /**\n * @param {(...args: any[]) => void} f\n */\n\n\n _createClass(WebSocketClient, [{\n key: \"onOpen\",\n value: function onOpen(f) {\n this.client.onopen = f;\n }\n /**\n * @param {(...args: any[]) => void} f\n */\n\n }, {\n key: \"onClose\",\n value: function onClose(f) {\n this.client.onclose = f;\n } // call f with the message string as the first argument\n\n /**\n * @param {(...args: any[]) => void} f\n */\n\n }, {\n key: \"onMessage\",\n value: function onMessage(f) {\n this.client.onmessage = function (e) {\n f(e.data);\n };\n }\n }]);\n\n return WebSocketClient;\n}();\n\nexport { WebSocketClient as default };","map":{"version":3,"names":["_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_createClass","protoProps","staticProps","prototype","log","WebSocketClient","url","client","WebSocket","onerror","error","value","onOpen","f","onopen","onClose","onclose","onMessage","onmessage","e","data","default"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/webpack-dev-server/client/clients/WebSocketClient.js"],"sourcesContent":["function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport { log } from \"../utils/log.js\";\n\nvar WebSocketClient = /*#__PURE__*/function () {\n /**\n * @param {string} url\n */\n function WebSocketClient(url) {\n _classCallCheck(this, WebSocketClient);\n\n this.client = new WebSocket(url);\n\n this.client.onerror = function (error) {\n log.error(error);\n };\n }\n /**\n * @param {(...args: any[]) => void} f\n */\n\n\n _createClass(WebSocketClient, [{\n key: \"onOpen\",\n value: function onOpen(f) {\n this.client.onopen = f;\n }\n /**\n * @param {(...args: any[]) => void} f\n */\n\n }, {\n key: \"onClose\",\n value: function onClose(f) {\n this.client.onclose = f;\n } // call f with the message string as the first argument\n\n /**\n * @param {(...args: any[]) => void} f\n */\n\n }, {\n key: \"onMessage\",\n value: function onMessage(f) {\n this.client.onmessage = function (e) {\n f(e.data);\n };\n }\n }]);\n\n return WebSocketClient;\n}();\n\nexport { WebSocketClient as default };"],"mappings":"AAAA,SAASA,eAAT,CAAyBC,QAAzB,EAAmCC,WAAnC,EAAgD;EAAE,IAAI,EAAED,QAAQ,YAAYC,WAAtB,CAAJ,EAAwC;IAAE,MAAM,IAAIC,SAAJ,CAAc,mCAAd,CAAN;EAA2D;AAAE;;AAEzJ,SAASC,iBAAT,CAA2BC,MAA3B,EAAmCC,KAAnC,EAA0C;EAAE,KA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