API Docs for: 0.1.0
Show:

zerk.observable Class

Module: zerk

Observable

This class implements the observer pattern.

All observable classes should inherit from here.

Item Index

Methods

Properties

Methods

fireEvent

(
  • event
)
Boolen

Fire event

Parameters:

  • event String

    Event name

Returns:

Boolen: Returns false when the bubble was canceled

init

()

Class constructor

on

(
  • event
  • callback
  • scope
)

Register event handler

Parameters:

  • event String

    Event name

  • callback Function

    Callback function. Return false to cancel event bubble.

  • scope Object

    Scope to be used in callback function

un

(
  • event
  • callback
)
Boolen

Unregister event handler

Parameters:

  • event String

    Event name

  • callback Function

    Callback function

Returns:

Boolen: Returns true on success

Properties

_eventListeners

Array protected

List of event handlers