Skip to content

Instantly share code, notes, and snippets.

@azaharafernandezguizan
Created April 18, 2021 14:19
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 azaharafernandezguizan/5cbe6c1b94ff10918ad0f59f1ae0d81b to your computer and use it in GitHub Desktop.
Save azaharafernandezguizan/5cbe6c1b94ff10918ad0f59f1ae0d81b to your computer and use it in GitHub Desktop.
Modified cortex methods
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