Class: Caman.Event

Defined in: src/core/event.coffee

Overview

Event system that can be used to register callbacks that get fired during certain times in the render process.

Class Method Summary

Class Method Details

+ (void) trigger(target, type, data = null)

Trigger an event.

Parameters:

  • target (Caman) Instance of Caman emitting the event.
  • type (String) The event type.
  • data (Object) Extra data to send with the event.

+ (void) listen(target, type, fn)
+ (void) listen(type, fn)

Listen for an event. Optionally bind the listen to a single instance or all instances.

Overloads:

+ (void) listen(target, type, fn)

Listen for events emitted from a particular Caman instance.

Parameters:

  • target (Caman) The instance to listen to.
  • type (String) The type of event to listen for.
  • fn (Function) The function to call when the event occurs.

+ (void) listen(type, fn)

Listen for an event from all Caman instances.

Parameters:

  • type (String) The type of event to listen for.
  • fn (Function) The function to call when the event occurs.