Class: Object

Object

new Object(options, data)

Base object class which provides custom event management. In theory, every framework class should extend this class.

Parameters:
Name Type Argument Description
options Object <optional>

Class options.

data * <optional>

Class data

Source:

Extends

  • goog.events.EventTarget

Members

<static> EventTypes :string

Events enum emitted by the Object at some point.

Type:
  • string
Properties:
Name Type Default Description
DESTROYED string Destroyed
Source:

Methods

destroy()

Destroys the object. Emits the following events before and after the object is destroyed. Sets data and options to null and calls the dispose and disposeInternal on parent to make a proper clean up. Calling dispose will set the Object.isDisposed to true and calling disposeInternal will unlisten all binded events so there won't be any event and/or memory leak.

Source:

emit(eventName, data)

Dispatches an event and calls all listeners listening for events of this event. See also goog.events.Listenable.prototype.dispatchEvent

Parameters:
Name Type Argument Description
eventName string

Name of the event.

data * <optional>

Data which will passed to listeners

Source:

freeze()

Freezes object to prevent adding new properties, updating or deleting existing properties.

Source:

getData() → {*}

Returns class data.

Source:
Returns:

Class data.

Type
*

getOption() → {*}

Returns value of a key in options object.

Source:
Returns:

Value of key or null.

Type
*

getOptions() → {Object}

Returns all options object.

Source:
Returns:

Options object.

Type
Object

getUid() → {string}

Return unique id.

Source:
Returns:

Unique id of this component.

Type
string

isDestroyed() → {boolean}

Returns the object's destroy state.

Source:
Returns:

Whether the object is destroyed or not.

Type
boolean

off(eventName, callback) → {boolean}

Removes an event listener which was added with @on or @once. See also goog.events.Listenable.prototype.unlisten

Parameters:
Name Type Description
eventName string

Name of the event.

callback function

Callback function for the event.

Source:
Returns:

Whether any listener was removed.

Type
boolean

on(eventName, callback) → {goog.events.ListenableKey|number}

Adds an event listener. See also goog.events.Listenable::listen

Parameters:
Name Type Description
eventName string

Name of the event.

callback function

Callback function for the event.

Source:
Returns:

Unique key for the listener.

Type
goog.events.ListenableKey | number

once(eventName, callback) → {goog.events.ListenableKey|number}

Adds an event listener that is removed automatically after the listener fired once. See also goog.events.Listenable.prototype.listenOnce

Parameters:
Name Type Description
eventName string

Name of the event.

callback function

Callback function for the event.

Source:
Returns:

Unique key for the listener.

Type
goog.events.ListenableKey | number

setData(data)

Sets data of this class.

Parameters:
Name Type Description
data *

Data passed to class.

Source:

setOptions(options)

Sets options object of this class.

Parameters:
Name Type Description
options Object

Options object.

Source:

<private> setUid_()

Sets uid.

Source:
Spark Framework by Fatih Acet
Copyright © 2014 - Fatih Acet
Documentation generated by JSDoc 3.2.2 on 2015-07-19T22:09:34+00:00 using the DocStrap template.