Always resolve ready when created, never reject (#563)

This commit is contained in:
Jaco Greeff
2019-01-10 11:16:02 +01:00
committed by GitHub
parent 89a3c9647a
commit 62723caf55
+4 -8
View File
@@ -157,14 +157,10 @@ export default class ApiPromise extends ApiBase<DecoratedRpc, QueryableStorage,
constructor (options?: ApiOptions | ProviderInterface) {
super(options);
this._isReady = new Promise((resolveReady, rejectReady) =>
super
.once('ready', () =>
resolveReady(this)
)
.once('error', () =>
rejectReady(this)
)
this._isReady = new Promise((resolveReady) =>
super.once('ready', () =>
resolveReady(this)
)
);
}