pusher/pusher-js — Issue #11: state_change event does not fire when connection is lost
Author: leggetter
Created: 2011-11-01 16:22:29+00:00
State: open

pusher.connection.bind('state_change', function(states) {
// states = {previous: 'oldState', current: 'newState'}
$('span#status').html(" [" + states.current + "]");
});

> if I put my laptop to sleep for the night and wake it up in the morning, the status never refreshes. I thought these events would handle that.

Further details can be found in the following support issue (requires permissioned login): https://pusher.tenderapp.com/discussions/questions/297-state_change-event-does-not-fire-when-connection-is-lost