/** @module decor/Evented */
define(["dcl/dcl", "dcl/advise"], function (dcl, advise) {
	/**
	 * Base class to add on() and emit() methods to a class for listening for events and emitting events:
	 * @example
	 * var EventedSubClass = dcl(Evented, {...});
	 * var instance = new EventedSubClass();
	 * instance.on("open", function (event) {
	 *     ... do something with event
	 * });
	 * instance.emit("open", {name:"some event", ...});
	 * @mixin module:delite/Container
	 * @augments module:delite/Widget
	 */
	return dcl(null, {
		/**
		 * Setup listener to be called when specified event is fired.
		 * @param {string} type - Name of event.
		 * @param {Function} listener - Callback for when event occurs.
		 * @returns {Object} Handle with `remove()` method to stop listening to event.
		 */
		on: function (type, listener) {
			return advise.before(this, "on" + type, listener);
		},

		/**
		 * Emit specified event.
		 * @param {string} type - Name of event.
		 * @param {...anything} var_args Parameters to pass to the listeners for this event.
		 */
		emit: function (type) {
			var func = "on" + type;
			if (this[func]) {
				var args = Array.prototype.slice.call(arguments, 1);
				this[func].apply(this, args);
			}
		}
	});
});

@@ -112,23 +112,27 @@
 add 
+%60
 on()
+%60
  and 
+%60
 emit()
+%60
  met
@@ -191,17 +191,17 @@
 g events
-:
+.
 %0A%09 * @ex
@@ -414,16 +414,17 @@
 , %7Bname:
+ 
 %22some ev
@@ -460,80 +460,78 @@
 e:de
-lite/Container%0A%09 * @augments module:delite/Widget%0A%09 */%0A%09return dcl(null,
+cor/Evented%0A%09 */%0A%09return dcl(null, /** @lends module:decor/Evented# */
  %7B%0A%09
@@ -748,14 +748,15 @@
 th %60
-remove
+destroy
 ()%60 

fix Evented API doc, fixes #18