src/nopg.js
function new_listener(event/*, listener*/) {

			// Ignore if not tcn event
			if(NoPg.isLocalEventName(event)) {
				return;
			}

			event = NoPg.parseEventName(event);

			// Stringifying back the event normalizes the original event name
			var event_name = NoPg.stringifyEventName(event);

			var channel_name = NoPg.parseTCNChannelName(event);

			// If we are already listening, just increase the counter.
			if(counter.hasOwnProperty(event_name)) {
				counter[event_name] += 1;
				return;
			}

			// Create the listener if necessary
			var tcn_listener;
			if(!tcn_listeners.hasOwnProperty(event_name)) {
				tcn_listener = tcn_listeners[event_name] = create_tcn_listener(self._events, event);
			} else {
				tcn_listener = tcn_listeners[event_name];
			}

			// Start listening tcn events for this channel
			//debug.log('Listening channel ' + channel_name + ' for ' + event_name);
			self._db.on(channel_name, tcn_listener);
			counter[event_name] = 1;
		}
function new_listener(event/*, listener*/) {

			// Ignore if not tcn event
			if(NoPg.isLocalEventName(event)) {
				return;
			}

			event = NoPg.parseEventName(event);

			// Stringifying back the event normalizes the original event name
			var event_name = NoPg.stringifyEventName(event);

			var channel_name = NoPg.parseTCNChannelName(event);

			// If we are already listening, just increase the counter.
			if(counter.hasOwnProperty(event_name)) {
				counter[event_name] += 1;
				return;
			}

			// Create the listener if necessary
			var tcn_listener;
			if(!tcn_listeners.hasOwnProperty(event_name)) {
				tcn_listener = tcn_listeners[event_name] = create_tcn_listener(self._events, event);
			} else {
				tcn_listener = tcn_listeners[event_name];
			}

			// Start listening tcn events for this channel
			//debug.log('Listening channel ' + channel_name + ' for ' + event_name);
			self._db.on(channel_name, tcn_listener);
			counter[event_name] = 1;
		}
function new_listener ( event /*, listener*/ ) { // Ignore if not tcn event if ( NoPg . isLocalEventName ( event ) ) { return ; } event = NoPg . parseEventName ( event ) ; // Stringifying back the event normalizes the original event name var event_name = NoPg . stringifyEventName ( event ) ; var channel_name = NoPg . parseTCNChannelName ( event ) ; // If we are already listening, just increase the counter. if ( counter . hasOwnProperty ( event_name ) ) { counter [ event_name ] += 1 ; return ; } // Create the listener if necessary var tcn_listener ; if ( ! tcn_listeners . hasOwnProperty ( event_name ) ) { tcn_listener = tcn_listeners [ event_name ] = create_tcn_listener ( self . _events , event ) ; } else { tcn_listener = tcn_listeners [ event_name ] ; } // Start listening tcn events for this channel //debug.log('Listening channel ' + channel_name + ' for ' + event_name); self . _db . on ( channel_name , tcn_listener ) ; counter [ event_name ] = 1 ; }
Listener for new listeners
Listener for new listeners