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:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user