mixins/evented.js

Mixins

EventedMixin

Methods

(inner) addEventedCallback(target, callback)

Adds a callback to run after the evented mixin applied.

Parameters:
NameTypeDescription
targetObject

An object to Add

callbackfunction

The callback to run.

(inner) evented(target, optionsopt) → {Object}

Applies EventedMixin to a target object.

Parameters:
NameTypeAttributesDefaultDescription
targetObject

The object to which to add event methods.

optionsObject<optional>
{}

Options for customizing the mixin behavior.

Properties
NameTypeAttributesDescription
eventBusKeystring<optional>

By default, adds a eventBusEl_ DOM element to the target object, which is used as an event bus. If the target object already has a DOM element that should be used, pass its key here.

Returns:

The target object.

Type: 
Object

(inner) isEvented(object) → {boolean}

Returns whether or not an object has had the evented mixin applied.

Parameters:
NameTypeDescription
objectObject

An object to test.

Returns:

Whether or not the object appears to be evented.

Type: 
boolean