Allow proper promise failure (#316)

* Allow proper promise failure

* Remove unneeded dep
This commit is contained in:
Jaco Greeff
2019-02-16 11:05:53 +01:00
committed by GitHub
parent b9a58f84b9
commit bc2b1344b7
4 changed files with 3 additions and 10 deletions
@@ -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
};