Skip to content

nlf/wadofgum-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wadofgum-events Build Status

An eventing mixin for wadofgum based on spit.

Usage

This module adds emit and on methods to your model class which can be used just as you would use the spit module by itself. To load it, apply it as a mixin to the base wadofgum module.

The only event emitted by default is the create event, which will be triggered every time an instance of your class is created passing the instance as the parameter.

const Wadofgum = require('wadofgum');
const Events = require('wadofgum-events');

class Model extends Wadofgum.mixin(Events) {};
Model.on('test', function () {
});

Model.emit('test');

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published