Browse Source

Pull request #2295: 无JIRA任务 优化代码

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit 'f91c1c0cfa4b58a29cb9867bc794e03d19b3c7a2':
  优化代码
es6
guy 3 years ago
parent
commit
30e3e782c0
  1. 19
      src/core/6.inject.js

19
src/core/6.inject.js

@ -31,6 +31,9 @@
} }
} }
moduleInjection[xtype] = cls; moduleInjection[xtype] = cls;
return function () {
return BI.Modules.getModule(xtype);
};
}; };
var constantInjection = {}; var constantInjection = {};
@ -41,7 +44,7 @@
constantInjection[xtype] = cls; constantInjection[xtype] = cls;
return function () { return function () {
return BI.Constants.getConstant(xtype); return BI.Constants.getConstant(xtype);
} };
}; };
var modelInjection = {}; var modelInjection = {};
@ -50,7 +53,7 @@
_global.console && console.error("model: [" + xtype + "] 已经注册过了"); _global.console && console.error("model: [" + xtype + "] 已经注册过了");
} }
modelInjection[xtype] = cls; modelInjection[xtype] = cls;
return function (xtype, config) { return function (config) {
return BI.Models.getModel(xtype, config); return BI.Models.getModel(xtype, config);
}; };
}; };
@ -61,9 +64,9 @@
_global.console && console.error("store: [" + xtype + "] 已经注册过了"); _global.console && console.error("store: [" + xtype + "] 已经注册过了");
} }
storeInjection[xtype] = cls; storeInjection[xtype] = cls;
return function (xtype, config) { return function (config) {
return BI.Stores.getStore(xtype, config); return BI.Stores.getStore(xtype, config);
} };
}; };
var serviceInjection = {}; var serviceInjection = {};
@ -72,9 +75,9 @@
_global.console && console.error("service: [" + xtype + "] 已经注册过了"); _global.console && console.error("service: [" + xtype + "] 已经注册过了");
} }
serviceInjection[xtype] = cls; serviceInjection[xtype] = cls;
return function (xtype, config) { return function (config) {
return BI.Services.getService(xtype, config); return BI.Services.getService(xtype, config);
} };
}; };
var providerInjection = {}; var providerInjection = {};
@ -83,9 +86,9 @@
_global.console && console.error("provider: [" + xtype + "] 已经注册过了"); _global.console && console.error("provider: [" + xtype + "] 已经注册过了");
} }
providerInjection[xtype] = cls; providerInjection[xtype] = cls;
return function (xtype, config) { return function (config) {
return BI.Providers.getProvider(xtype, config); return BI.Providers.getProvider(xtype, config);
} };
}; };
var configFunctions = {}; var configFunctions = {};

Loading…
Cancel
Save