nl_tokens: Handle diffing of previous and current event maps .
pl_tokens: function updateEventListeners ( el , prevEvents , events ) { var eventName ; if ( ! prevEvents || ! events || prevEvents === events ) { return ; } for ( eventName in events ) { // Didn't change. if ( prevEvents [ eventName ] === <mask> [ eventName ] ) { continue ; } // If changed, remove old previous event listeners. if ( prevEvents [ eventName ] ) { removeEventListeners ( el , eventName , prevEvents [ eventName ] ) ; } // Add new event listeners. addEventListeners ( el , eventName , events [ eventName ] ) ; } // See if event handlers were removed. for ( eventName in prevEvents ) { if ( ! events [ eventName ] ) { removeEventListeners ( el , eventName , prevEvents [ eventName ] ) ; } } }