Allow proper promise failure (#316)
* Allow proper promise failure * Remove unneeded dep
This commit is contained in:
@@ -258,7 +258,6 @@ const createPromise = require('./schnorrkel_js_bg');
|
||||
const wasmPromise = createPromise(wasmImports);
|
||||
|
||||
module.exports.isReady = function () { return !!wasm; }
|
||||
module.exports.waitReady = function () { return wasmPromise.then(() => true); }
|
||||
|
||||
wasmPromise.then((_wasm) => { wasm = _wasm });
|
||||
module.exports.waitReady = function () { return wasmPromise.then(() => !!wasm); }
|
||||
|
||||
wasmPromise.then((_wasm) => { wasm = _wasm }).catch(() => {});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
const bytes = require('./schnorrkel_js_wasm');
|
||||
|
||||
module.exports = function createExportPromise (wasmImports) {
|
||||
module.exports = async function createExportPromise (wasmImports) {
|
||||
const imports = {
|
||||
'./schnorrkel_js': wasmImports
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user