 	###
 	Register an event handler with the mediator
 
-	event - string - event name ('resize', 'scroll', etc)
-	callback - function
+	event - string - event name ('resize', 'scroll', etc) callback - function
 	options
 		throttle [100] - int - milliseconds to throttle
 		debounce [100] - int - milliseconds to debounce

		@handlers[event].callbacks.push callback

	###
	Fires all events for a given window event type,
	padding the native event object through to the mediated callback

	e - Event - native event object
	###
	fire: (e) =>
		_.eachRight @handlers[e.type].callbacks, (cb) -> cb(e); true

module.exports = new WindowEventMediator()

	set: (event, callback, options) =>
		key = options.throttle+'-'+options.debounce

		# If the event type hasn't been added, create an object to store the
		# callbacks and a record of which throttle.debounce listeners have been
		# added
		if !@handlers[event]?
			@handlers[event] = {callbacks: [], keys: {}}

