Add connected() to API interface (#2580)

* Add connected() to API interface

* Slight doc update

* Align ApiRx

* isConnected() usage

* Updates

* Retrieve isConnected for API via observable

* Remove (now) useless Rx test
This commit is contained in:
Jaco Greeff
2020-09-04 17:57:02 +02:00
committed by GitHub
parent 4f4833da74
commit 00bc441f0e
17 changed files with 125 additions and 72 deletions
+16 -2
View File
@@ -129,11 +129,25 @@ export default class Rpc implements RpcInterface {
this.addUserInterfaces(userRpc);
}
/**
* @description Returns the connected status of a provider
*/
public get isConnected (): boolean {
return this.provider.isConnected;
}
/**
* @description Manually connect from the attached provider
*/
public connect (): Promise<void> {
return this.provider.connect();
}
/**
* @description Manually disconnect from the attached provider
*/
public disconnect (): void {
this.provider.disconnect();
public disconnect (): Promise<void> {
return this.provider.disconnect();
}
/**