Integrate supported ops into the UI

This commit is contained in:
Ingvar Stepanyan
2021-07-26 13:09:10 +00:00
parent 95ed711729
commit e3ea463db5
6 changed files with 49 additions and 44 deletions

View File

@@ -2,12 +2,13 @@ import initModule from '../libapi.mjs';
/** @typedef {import('../libapi.mjs').Context} Context */
const ContextPromise = initModule().then(Module => Module.Context);
const ModulePromise = initModule();
export async function connect() {
let Context = await ContextPromise;
const Module = await ModulePromise;
let context = await new Context();
let context = await new Module.Context();
let supportedOps = await context.supportedOps();
let queue = Promise.resolve();
@@ -30,6 +31,7 @@ export async function connect() {
}
return {
supportedOps,
schedule,
disconnect() {
context.delete();