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:
@@ -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> => {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user