Skip to content

Instantly share code, notes, and snippets.

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