Created
May 12, 2019 13:27
-
-
Save ovpv/ed6cad11360f119dd006c25a3c19367d to your computer and use it in GitHub Desktop.
Array to object websocket connect and foreach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidMount() { | |
this.socket = new WebSocket(ConfigData.url); | |
this.socket.onmessage = event => { | |
let Data = JSON.parse(event.data); | |
Data.forEach(([name, price]) => { | |
... | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment