Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ovpv
Created May 12, 2019 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ovpv/ed6cad11360f119dd006c25a3c19367d to your computer and use it in GitHub Desktop.
Save ovpv/ed6cad11360f119dd006c25a3c19367d to your computer and use it in GitHub Desktop.
Array to object websocket connect and foreach
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