Created
April 18, 2021 14:19
-
-
Save azaharafernandezguizan/5cbe6c1b94ff10918ad0f59f1ae0d81b to your computer and use it in GitHub Desktop.
Modified cortex methods
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
sub(streams){ | |
this.socket.on('open',async ()=>{ | |
await this.checkGrantAccessAndQuerySessionInfo() | |
this.subRequest(streams, this.authToken, this.sessionId); | |
this.socket.on('message', (data)=>{ | |
if(this.isRecordToSave){ | |
this.recordSaved.push(JSON.parse(data)); | |
this.numberOfRecords++; | |
this.isRecordToSave = this.numberOfRecords < 10; | |
} | |
}) | |
}) | |
} | |
recordResponse(){ | |
this.isRecordToSave = true; | |
} | |
getCurrentData(){ | |
return this.recordSaved; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment