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
+1 -1
View File
@@ -31,7 +31,7 @@ describe('Http', (): void => {
});
it('always returns isConnected true', (): void => {
expect(http.isConnected()).toEqual(true);
expect(http.isConnected).toEqual(true);
});
it('does not (yet) support subscribe', (): Promise<number | void> => {
+9 -2
View File
@@ -67,10 +67,17 @@ export default class HttpProvider implements ProviderInterface {
throw new Error('Unimplemented');
}
/**
* @description Manually connect from the connection
*/
public async connect (): Promise<void> {
// noop
}
/**
* @description Manually disconnect from the connection
*/
public disconnect (): void {
public async disconnect (): Promise<void> {
// noop
}
@@ -78,7 +85,7 @@ export default class HttpProvider implements ProviderInterface {
* @summary Whether the node is connected or not.
* @return {boolean} true if connected
*/
public isConnected (): boolean {
public get isConnected (): boolean {
return true;
}