further refactorings, got rid of init.js

This commit is contained in:
azivner
2018-03-26 22:29:14 -04:00
parent 57d19f3302
commit 788ac43ad1
10 changed files with 264 additions and 226 deletions

View File

@@ -1,4 +1,5 @@
import ScriptContext from "./script_context.js";
import server from "./server.js";
async function executeBundle(bundle) {
const apiContext = ScriptContext(bundle.note, bundle.allNotes);
@@ -8,6 +9,15 @@ async function executeBundle(bundle) {
}.call(apiContext));
}
async function executeStartupBundles() {
const scriptBundles = await server.get("script/startup");
for (const bundle of scriptBundles) {
await executeBundle(bundle);
}
}
export default {
executeBundle
executeBundle,
executeStartupBundles
}