bitovi/canjs — pull request #870 by andykant (2014-04-04 21:42:41+00:00)
Title: can/event

This adds support for the `can/event` mixin. This replaces `can/util/event.js` (although that module has been updated to maintain support for the old API). The mixin provides common event methods: addEvent/removeEvent/on/off/dispatch/trigger/etc.

`can/event` implements high performance event support for normal objects and prototypes, but unlike before, can now be easily mixed into objects and prototypes: `can.extend(SomeClass.prototype, can.event)`

Along with the basic `can/event` mixin, there are also some plugins included:

- `can/event/propagate`: **Official Plugin** Adds event propagation for normal objects.
- `can/event/delegate`: **Beta Plugin** Adds event delegation; this is not an official plugin yet as it could use some API refinement. Currently it only supports delegation for objects created and named with can.Construct-derived classes.
- `can/event/namespace`: **Beta Plugin** Adds event namespacing; this is not an official plugin yet as it conflicts with can.Map events. Currently can.Maps are excluded from namespacing, but it might be better to drop this plugin entirely and encourage users to use `can.event.listenTo` and `can.event.stopListening` to manage event handlers owned by another object.

This pull request completes #768 and #769, and also includes the changes made in #760.