Sha256: 00d44dc8eb84919801d92214071cdc9c60788bb74b1c45b1751a86c833b8204d

Contents?: true

Size: 442 Bytes

Versions: 1

Compression:

Stored size: 442 Bytes

Contents

//Global task list
Rebar.tasks = [];

Rebar.Task = function(name) {
  this.name = name;
  Rebar.tasks.push(this);

  this.sendEvent = function(type, info) {
    info.type = type;
    Rebar.sendEvent(info);
  }

  var handlers = [];
  this.on = function(name, callback) {
    handlers[name] = callback;
  }

  this.handle = function(type, event) {
    handler = handlers[type];
    if (handler != undefined) {
      handler(event)
    }
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flok-0.0.1 lib/js/kernel/task.js