Remove Promise chain, fix formatting test subscription (#1218)

This commit is contained in:
Jaco Greeff
2019-07-28 00:20:43 +02:00
committed by GitHub
parent 4094b44625
commit c31bd20c6a
2 changed files with 6 additions and 7 deletions
+3 -6
View File
@@ -198,12 +198,9 @@ export default class Rpc implements RpcInterface {
observer.next(this.formatOutput(method, params, result));
};
// FIXME This is a work-around, provider.subscribe _should_ always return,
// however in some cases `this.provider.subscribe.catch` yields ".catch of
// undefined", so here we flatten via Promise.reolve (which doe sfollow)
subscriptionPromise = Promise.resolve(
this.provider.subscribe(subType, subName, paramsJson, update)
).catch(errorHandler);
subscriptionPromise = this.provider
.subscribe(subType, subName, paramsJson, update)
.catch(errorHandler);
} catch (error) {
errorHandler(error);
}