Last active
January 29, 2018 15:52
-
-
Save gemma-vincent/21468515ec52505ddb198b06dd662ed6 to your computer and use it in GitHub Desktop.
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
//Connects to the socket | |
const socket = io('https://9b547253.ngrok.io'); | |
let data = new Array(); | |
//Once we are connected do this shit | |
socket.on('instantPower', function(instantPower) { | |
console.log(instantPower); | |
data.push(instantPower); | |
if ( data.length > 10 ) { | |
data = data.slice(1, 11); | |
} | |
console.log(data); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment