Turbolinks support for Pusher.js
;(function($, Pusher) { | |
/* Resets all callbacks */ | |
Pusher.prototype.reset = function() { | |
$.each(this.channels.channels, function(name, channel) { | |
channel.callbacks._callbacks = {} | |
}) | |
} | |
$(document).on('page:receive', function() { | |
$.each(Pusher.instances, function(index, instance) { | |
instance.reset() | |
}) | |
}) | |
})(jQuery, Pusher); |
This comment has been minimized.
This comment has been minimized.
I'm actually having trouble getting this to work properly. My connections keep stacking with just one user on the site. The order of my js is: pusher.min Still stacking connections though. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Thanks for this!