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
@@ -84,6 +84,13 @@ export default class Rpc implements RpcInterface {
return `${method} (${inputs}): ${type}`;
}
/**
* @description Manually disconnect from the attached provider
*/
disconnect (): void {
this._provider.disconnect();
}
private createInterface ({ methods }: RpcSection): RpcInterface$Section {
return Object
.keys(methods)