mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(client) init
This commit is contained in:
parent
dfee961458
commit
7a95e0439e
1 changed files with 9 additions and 12 deletions
|
|
@ -1,11 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
/* global Util, DOM */
|
||||
|
||||
const itype = require('itype/legacy');
|
||||
const rendy = require('rendy');
|
||||
const exec = require('execon');
|
||||
const Images = require('./dom/images');
|
||||
const join = require('join-io/www/join');
|
||||
const jonny = require('jonny/legacy');
|
||||
const bind = (f, ...a) => () => f(...a);
|
||||
|
||||
const {
|
||||
apiURL,
|
||||
|
|
@ -13,8 +16,6 @@ const {
|
|||
buildFromJSON,
|
||||
} = require('../common/cloudfunc');
|
||||
|
||||
/* global Util, DOM */
|
||||
|
||||
module.exports = new CloudCmdProto(Util, DOM);
|
||||
|
||||
function CloudCmdProto(Util, DOM) {
|
||||
|
|
@ -173,16 +174,12 @@ function CloudCmdProto(Util, DOM) {
|
|||
* инициализации
|
||||
*/
|
||||
this.init = (prefix, config) => {
|
||||
const func = () => {
|
||||
exec.series([
|
||||
initModules,
|
||||
baseInit,
|
||||
loadPlugins,
|
||||
() => {
|
||||
CloudCmd.route(location.hash);
|
||||
}
|
||||
]);
|
||||
};
|
||||
const func = bind(exec.series, [
|
||||
initModules,
|
||||
baseInit,
|
||||
loadPlugins,
|
||||
exec.with(CloudCmd.route, location.hash),
|
||||
]);
|
||||
|
||||
const funcBefore = (callback) => {
|
||||
const src = prefix + '/join:' + [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue