 
     @afterUnsubscribe?() if @subscriptionCount() < subscriptionCountBefore
 
+  # Public: When called, stops triggering any event.
   pauseEvents: ->
     @pauseCount ?= 0
     if @pauseCount++ == 0
       @queuedEvents ?= []
 
+  # Public: When called, resumes triggering events.
   resumeEvents: ->
     if --@pauseCount == 0
       queuedEvents = @queuedEvents
       @queuedEvents = null
       @trigger(event...) for event in queuedEvents
 
+  # Public: Identifies how many events are registered.
+  #
+  # Returns a `number`.
   subscriptionCount: ->
     count = 0
     for name, handlers of @eventHandlersByEventName

_ = require 'underscore'

module.exports =
  on: (eventName, handler) ->
    [eventName, namespace] = eventName.split('.')



    @on eventName, oneShotHandler

  # Public: Triggers a registered event.
  #
  # eventName - A {String} name identifying an event
  # args - Any additional arguments to pass over to the event `handler`
  trigger: (eventName, args...) ->
    if @queuedEvents
      @queuedEvents.push [eventName, args...]
