{"version":3,"file":"831.76d85efed7355b8a.js","mappings":"qOA+CA,QAjCa,WACT,IAAMA,GAAWC,EAAAA,EAAAA,MA4BjB,OA1BAC,EAAAA,EAAAA,YAAU,WACNC,EAAAA,EAAGC,UAAUC,MAAK,WAEdF,EAAAA,EAAGG,GAAG,UAAU,SAACC,GACb,IAAMC,EAAOC,KAAKC,MAAMH,GACxBP,EAAS,CAAEW,KAAOC,EAAAA,GAAoBC,QAAUL,EAAKK,QAASC,QAAUN,EAAKM,SAEjF,IAEAX,EAAAA,EAAGG,GAAG,eAAe,SAACC,GACdA,EAAIQ,KAAKC,KAAOC,EAAAA,EAAKC,aACrBlB,GAASmB,EAAAA,EAAAA,IAAYZ,EAAIa,aAAaJ,GAAIT,EAAIc,QAAUd,EAAIc,OAAOL,GAAIT,GAE/E,IAEAJ,EAAAA,EAAGG,GAAG,gBAAgB,SAACC,GACnBP,GAASsB,EAAAA,EAAAA,IAAiBf,GAC9B,GAEJ,GAIJ,GAAG,IAGI,IACX,C","sources":["webpack://season-fantasy-app/./src/containers/Live.jsx"],"sourcesContent":["import React, { useEffect } from 'react'\r\n\r\nimport { useDispatch } from 'react-redux'\r\n\r\nimport { wsOnNewPost } from '../redux/messageBoard/actions'\r\nimport { wsOnNotification } from '../redux/notification/actions'\r\n\r\nimport ws from '../common/WebSocketClient'\r\nimport * as wsTypes from '../redux/ws/types'\r\nimport * as matchTypes from '../redux/match/types'\r\n\r\nimport auth from '../common/auth'\r\n\r\n\r\nconst Live = () => {\r\n const dispatch = useDispatch();\r\n\r\n useEffect(() => {\r\n ws.connect().then(() => {\r\n \r\n ws.on('update', (obj) => { \r\n const jobj = JSON.parse(obj);\r\n dispatch({ type : wsTypes.WS_MESSAGE, message : jobj.message, payload : jobj.payload });\r\n\r\n });\r\n\r\n ws.on('PostCreated', (obj) => {\r\n if (obj.user.id !== auth.getUserId()) {\r\n dispatch(wsOnNewPost(obj.messageBoard.id, obj.parent && obj.parent.id, obj));\r\n }\r\n });\r\n\r\n ws.on('Notification', (obj) => {\r\n dispatch(wsOnNotification(obj));\r\n });\r\n\r\n })\r\n\r\n\r\n \r\n }, []);\r\n\r\n\r\n return null;\r\n}\r\n\r\n\r\nexport default Live;\r\n\r\n"],"names":["dispatch","useDispatch","useEffect","ws","connect","then","on","obj","jobj","JSON","parse","type","wsTypes","message","payload","user","id","auth","getUserId","wsOnNewPost","messageBoard","parent","wsOnNotification"],"sourceRoot":""}