Skip to content

Dexie.events()

David Fahlander edited this page May 6, 2014 · 3 revisions

Create a set of events

Sample

function Car() {
    this.on = Dexie.events(this, "move", "stop", "crash");
}

Car.prototype.move = function() {
    this.on.move.fire();
}

var car = new Car();
car.on('move', function() {
    alert ("Oh, it's moving!");
});
car.move();
Clone this wiki locally