Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Components

Jon Parsons edited this page Feb 16, 2015 · 1 revision

Scribe Components

Event Emitter

Setup

var emitter = new EventEmitter();

Methods

on

emitter.on('event-key', function eventHandle(){ /*do some stuff*/ });

Allow an event handle to be registered to a specific event key.

off

emitter.off('event-key', function eventHandle(){ /*do some stuff*/ });

Remove an event handle for a given event key.

trigger

emitter.trigger('event-key');

Trigger all event handles for a given event key.

Waterfall Events

The scribe event emitter has limited functionality for ordering events. If you register an event key of my:custom:event event execution will look like this:

First emitter.trigger('my:custom:event')

Second emitter.trigger('my:custom')

Last emitter.trigger('my')

Clone this wiki locally