linnovate / meanio

meanio core module
MIT License
54 stars 73 forks source link

generic events implementation. disables stacksight. #97

Closed timelf123 closed 8 years ago

timelf123 commented 8 years ago

Keeping to the standard set before, if an event has an action, that is the name of the event. You can also pass a string as the name

Action

Articles.events.publish({
    action: 'article:deleted',
    user: {
        name: req.user.name
    },
    name: article.title
});

String

Articles.events.publish('article:deleted');

Subscribing: PackageName.events.subscribe('article:deleted', function(){console.log('event fired')});

Fixes #96

timelf123 commented 8 years ago

Submitting against https://github.com/linnovate/meanio/tree/0.9.0 instead