wookieb / alpha-dic

Powerful dependency injection container for node.js
MIT License
27 stars 0 forks source link

Allow to add an annotation as entire object #1

Closed wookieb closed 7 years ago

wookieb commented 7 years ago

Instead doing this

dic.service('name').annotate('annotation-name', {property: 1});

Allow to do this

dic.service('name').annotate({name: 'annotation-name', property: 1});

This feature will allow to have predefined functions for creating annotations

const eventListener = (name, priority) => {
   return {name: 'event-listener', event: name, priority: priority || 50};
};
dic.service('name').annotate(eventListener('event-name', 10))