Skip to content

Instantly share code, notes, and snippets.

@ZackMattor
Last active May 23, 2016 16:29
Show Gist options
  • Select an option

  • Save ZackMattor/ff0f2c2d992ef76fa333a2c8a6029999 to your computer and use it in GitHub Desktop.

Select an option

Save ZackMattor/ff0f2c2d992ef76fa333a2c8a6029999 to your computer and use it in GitHub Desktop.
;(function($, Pusher) {
/* Resets all callbacks */
Pusher.prototype.reset = function() {
$.each(this.channels.channels, function(name, channel) {
channel.callbacks._callbacks = {}
})
}
$(document).on('pjax:send', function() {
$.each(Pusher.instances, function(index, instance) {
instance.reset()
})
})
})(jQuery, Pusher);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment