linnovate / meanio

meanio core module
MIT License
54 stars 73 forks source link

Remove sts and add generic event handler #98

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. I've removed types as they seemed STS specific

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

clowenhg commented 8 years ago

Looks good to me