- Assigns on and off methods to the given object, returing a bound dispatch function. The returned function is typically assigned to the dispatch property of the same object, but this is not required.
- dispatch.on(t, f)
Registers the given event listener f to receive events of type t, where f is a function and t is a string; returns this. When an event of the given type is dispatched, any registered listeners will receive the given event as a single argument to the function f. The this context of the function will be this dispatch object.
This method is similar to the W3C-specified addEventListener.
- dispatch.off(t, f)
Removes the given event listener f from events of type t, where f is a function and t is a string; returns this. If the listener f is not registered to receive events of type t then this method has no effect.
This method is similar to the W3C-specified removeEventListener.
- Dispatches the given event e to any registered listeners. The event e must have a type string attribute, which determines which listeners will be notified. This method is typically not needed unless implementing a custom layer.