Skip to content

Instantly share code, notes, and snippets.

@christiannwamba
Created December 21, 2017 14:18
Show Gist options
  • Save christiannwamba/d0bc7b374191233f18afe9b86791f7c2 to your computer and use it in GitHub Desktop.
Save christiannwamba/d0bc7b374191233f18afe9b86791f7c2 to your computer and use it in GitHub Desktop.
this.channelName = window.location.pathname.replace(new RegExp('/', 'g'), '-');
var channel = this.pusher.subscribe(this.channelName);
channel.bind('new-comment', (comment) => {
this.comments.push(
{name: comment.name, content: comment.content}
)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment