 			@started.dispatch()
 
 		###
+        # Resets the dispatcher state after dispatching.
+        #
 		# @private
 		###
 		finalizeDispatching = () ->

	class Dispatcher

		###
		# @var {boolean} dispatching Wether or not the dispatcher is currently dispatching
		# @private
		###
		dispatching = no

			stores[id]._handleAction.call stores[id], currentAction, currentPayload, @waitFor
			isHandled[id] = yes

        ###
        # Registers a store with the dispatcher so that it's notified when actions
        # are dispatched.
        #
        # @param {Object} store The store to register with the dispatcher
        ###
		register: (store) ->
			stores[storeID] = store
			store._id = storeID++;


        ###
        # Unregisters a store from the dispatcher so that it's no longer 
        # notified when actions are dispatched.
        #
        # @param {Object} store The store to unregister from the dispatcher
        ###
		unregister: (store) ->
			invariant store._id? and stores[store._id]?,
				"dispatcher.unregister(...): Store is not registered with the dispatcher."
			delete stores[store._id]

        ###
        # Method for waiting for other stores to complete their handling
        # of actions. This method is passed along to the Stores when an action
        # is dispatched.
        #
        # @see notifyStore
        ###
		waitFor: (storeDependencies...) =>
			# We can only wait for dependencies if the dispatcher is dispatching.
			# In other words, waitFor() has to be called inside an action handler.
