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
-1
View File
@@ -29,7 +29,6 @@
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/util-crypto#readme",
"dependencies": {
"@babel/runtime": "^7.3.1",
"@parity/schnorrkel-js": "^0.1.2",
"@polkadot/util": "^0.34.16",
"@types/bip39": "^2.4.2",
"@types/webassembly-js-api": "^0.0.2",
@@ -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
};