[Example] Add composite services example

Add an example showing the use of composite services,
WTD-518.
This commit is contained in:
Victor Woeltjen
2014-11-05 17:38:14 -08:00
parent 3cbdb0b9e2
commit 074958317f
7 changed files with 199 additions and 0 deletions

View File

@ -0,0 +1,29 @@
/*global define,Promise*/
/**
* Module defining SomeAggregator. Created by vwoeltje on 11/5/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function SomeAggregator(someProviders) {
return {
getMessages: function () {
return someProviders.map(function (provider) {
return provider.getMessages();
}).reduce(function (a, b) {
return a.concat(b);
}, []);
}
};
}
return SomeAggregator;
}
);