Most of my .on events use closures:
ref.on( 'child_added', function( snapshot ) { userCallback( snapshot.val() ); } );
which means that it is not possible to turn off these monitors using .off (), since off needs the original callback pointer, as well as eventType. How can i do this?
My app (jQuery Mobile) is page based. When a user clicks on a specific page, I want to activate monitors. When the user leaves this page, I want to deactivate, so when they are entered again, I do not get multiple monitors. I think I want to call .off () only with eventType and remove all callbacks.
source share