Skip to content

Dexie.events()

David Fahlander edited this page Mar 16, 2016 · 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