simplify the implementation for app.remoteObjects

This commit is contained in:
Yorkie Liu 2015-12-31 17:34:10 +08:00 committed by yorkie
parent 88d41f84fd
commit 2748a68c05
1 changed files with 6 additions and 7 deletions

View File

@ -260,13 +260,12 @@ app.connector = function(name, connector) {
*/
app.remoteObjects = function() {
var result = {};
this.remotes().classes().forEach(function(sharedClass) {
result[sharedClass.name] = sharedClass.ctor;
});
return result;
return this.remotes().classes().reduce(
function(results, sharedClass) {
results[sharedClass.name] = sharedClass.ctor;
},
{}
);
};
/*!