Expose api.disconnect() (#664)

* Expose api.disconnect()

* Noop for non-WS disconnects
This commit is contained in:
Jaco Greeff
2019-02-08 16:32:38 +02:00
committed by GitHub
parent b122f0cde0
commit a2f863c56b
6 changed files with 45 additions and 1 deletions
+7
View File
@@ -226,6 +226,13 @@ export default abstract class ApiBase<CodecResult, SubscriptionResult> implement
return this._extrinsics as SubmittableExtrinsics<CodecResult, SubscriptionResult>;
}
/**
* @description Disconnect from the underlying provider, halting all comms
*/
disconnect (): void {
this._rpcBase.disconnect();
}
/**
* @description Attach an eventemitter handler to listen to a specific event
*