Class: Wraith.Base

Defined in: src/base.coffee

Overview

The base class for all Wraith objects. Includes binding to events, and emitting events.

Direct Known Subclasses

Wraith.BaseView, Wraith.Collection, Wraith.Model

Instance Method Summary

Constructor Details

- (void) constructor()

Constructor

Instance Method Details

- (void) bind(ev, cb) (bound)

Binds the given function (cb) to the given event (ev)

Parameters:

  • ev (String) Event to listen for.
  • cb (Function) Callback to be executed on event.

- (void) unbind(ev, cb) (bound)

Unbinds the given function (cb) from the given event (ev)

Parameters:

  • ev (String) Event to unbind.
  • cb (Function) Callback to unbind.

- (void) emit(event, args...) (bound)

Emits the given event to listneers

Parameters:

  • event (String) The name of the event to emit
  • args (Object) The data object to emit

- (void) proxy(fn)

Used to proxy a function call through this object.

Borrowed from Spine

Parameters:

  • fn (Function) The function to proxy

Author:

  • Paul Miller