|
|
@ -153,9 +153,14 @@ function verifyResponse(response, name) { |
|
|
|
function getFormsAnswers(socketObject, dispatch) { |
|
|
|
const [socketResponse, setSocketResponse] = useState(); |
|
|
|
|
|
|
|
socketObject.socketUrl.onerror = (e) => { |
|
|
|
console.log(e.message); |
|
|
|
}; |
|
|
|
|
|
|
|
socketObject.socketUrl.onmessage = ({ data }) => { |
|
|
|
setSocketResponse(data); |
|
|
|
}; |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
dispatch({ increment: verifyResponse(socketResponse, socketObject.name) }); |
|
|
|
}, [socketResponse]); |
|
|
|