remove global usage for wasm
ProxmoxAAS-Dashboard Code Style Check / lint-check (push) Successful in 16s
ProxmoxAAS-Dashboard Code Style Check / lint-check (push) Successful in 16s
This commit is contained in:
+1
-1
@@ -560,7 +560,7 @@ export default function init (path) {
|
||||
const wasm = obj.instance;
|
||||
global.wfa = wasm
|
||||
go.run(wasm);
|
||||
res()
|
||||
res(wasm)
|
||||
}
|
||||
if ('instantiateStreaming' in WebAssembly) {
|
||||
WebAssembly.instantiateStreaming(fetch(path), go.importObject).then(function (obj) {
|
||||
|
||||
@@ -5,10 +5,12 @@ import wfaInit from "../modules/wfa.js";
|
||||
|
||||
window.addEventListener("DOMContentLoaded", init);
|
||||
|
||||
var wfa;
|
||||
|
||||
async function init () {
|
||||
setAppearance();
|
||||
|
||||
wfaInit("modules/wfa.wasm");
|
||||
wfa = await wfaInit("modules/wfa.wasm");
|
||||
initInstances();
|
||||
|
||||
document.querySelector("#instance-add").addEventListener("click", handleInstanceAddButton);
|
||||
@@ -272,8 +274,8 @@ function sortInstances () {
|
||||
};
|
||||
criteria = (item, query) => {
|
||||
// lower is better
|
||||
const { score, CIGAR } = global.wfa.wfAlign(query, item, penalties, true);
|
||||
const alignment = global.wfa.DecodeCIGAR(CIGAR);
|
||||
const { score, CIGAR } = wfa.wfAlign(query, item, penalties, true);
|
||||
const alignment = wfa.DecodeCIGAR(CIGAR);
|
||||
return { score: score / item.length, alignment };
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user