refactor: core.starting
This commit is contained in:
parent
242c4ead9d
commit
0564ae5a52
|
@ -76,7 +76,7 @@ export const hooks = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when the application is starting. Use for order-independent initialization tasks.
|
* Invoked when the application is starting. Use for startup tasks.
|
||||||
*/
|
*/
|
||||||
'@flecks/core.starting': () => {
|
'@flecks/core.starting': () => {
|
||||||
console.log('starting!');
|
console.log('starting!');
|
||||||
|
|
|
@ -369,6 +369,7 @@ exports.Flecks = class Flecks {
|
||||||
const Flecks = compose(...mixinDescription.map(([, mixin]) => mixin))(this);
|
const Flecks = compose(...mixinDescription.map(([, mixin]) => mixin))(this);
|
||||||
const instance = new Flecks(runtime);
|
const instance = new Flecks(runtime);
|
||||||
await instance.gatherHooks();
|
await instance.gatherHooks();
|
||||||
|
await instance.invokeSequentialAsync('@flecks/core.starting');
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
"runtime.js"
|
"runtime.js"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@flecks/core": "^3.1.0"
|
"@flecks/core": "^3.1.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@flecks/build": "^3.1.3",
|
"@flecks/build": "^3.1.3",
|
||||||
|
|
|
@ -23,7 +23,6 @@ const {version} = require('../package.json');
|
||||||
debug('starting server...');
|
debug('starting server...');
|
||||||
try {
|
try {
|
||||||
global.flecks = await Flecks.from({...runtime, flecks: await loadFlecks()});
|
global.flecks = await Flecks.from({...runtime, flecks: await loadFlecks()});
|
||||||
await Promise.all(global.flecks.invokeFlat('@flecks/core.starting'));
|
|
||||||
await global.flecks.invokeSequentialAsync('@flecks/server.up');
|
await global.flecks.invokeSequentialAsync('@flecks/server.up');
|
||||||
debug('up!');
|
debug('up!');
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,6 @@ const {version} = require('@flecks/web/package.json');
|
||||||
try {
|
try {
|
||||||
const flecks = await Flecks.from(runtime);
|
const flecks = await Flecks.from(runtime);
|
||||||
window.flecks = flecks;
|
window.flecks = flecks;
|
||||||
await Promise.all(flecks.invokeFlat('@flecks/core.starting'));
|
|
||||||
await flecks.invokeSequentialAsync('@flecks/web/client.up');
|
await flecks.invokeSequentialAsync('@flecks/web/client.up');
|
||||||
const appMountContainerId = `#${config['@flecks/web'].appMountId}-container`;
|
const appMountContainerId = `#${config['@flecks/web'].appMountId}-container`;
|
||||||
window.document.querySelector(appMountContainerId).style.display = 'block';
|
window.document.querySelector(appMountContainerId).style.display = 'block';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user