[Framework] Simplify inputs to service compositor

Accept the full component array into the service
compositor; this will make it easier to add these
from the registar. WTD-518.
This commit is contained in:
Victor Woeltjen 2014-11-05 15:02:46 -08:00
parent d9f17dca83
commit 2d0d505b51

View File

@ -42,6 +42,12 @@ define(
return arguments[0]; return arguments[0];
} }
function hasType(type) {
return function (extension) {
return extension.type === type;
};
}
function makeName(category, service, index) { function makeName(category, service, index) {
return [ return [
service, service,
@ -148,12 +154,20 @@ define(
registerLatest(); registerLatest();
} }
function registerCompositeServices(components) {
registerComposites(
components.filter(hasType("provider")),
components.filter(hasType("aggregator")),
components.filter(hasType("decorator"))
);
}
return { return {
/** /**
* *
* @param {Array} components extensions of type component * @param {Array} components extensions of category component
*/ */
registerCompositeServices: registerComposites registerCompositeServices: registerCompositeServices
}; };
} }