Skip to content

Instantly share code, notes, and snippets.

@fender
Created January 3, 2016 12:40
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 fender/0f7db917258c41350cb9 to your computer and use it in GitHub Desktop.
Save fender/0f7db917258c41350cb9 to your computer and use it in GitHub Desktop.
const connection = new WebSocket(config.pubsub.url);
connection.onopen = () => {
connection.send({
login: {
username: this.state.user.id
}
});
connection.send({
subscribe: {
channel: this.state.user.get('language')
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment