Allow any provider into API constructor (#444)
* Allow any provider into API constructor * Update documentation * Remove combineLatest exposure (deprecation error) * Linting & test cleanups * Exclude docs from codeclimate
This commit is contained in:
@@ -49,6 +49,13 @@ export default class HttpProvider implements ProviderInterface {
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary `true` when this provider supports subscriptions
|
||||
*/
|
||||
get hasSubscriptions (): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Whether the node is connected or not.
|
||||
* @return {boolean} true if connected
|
||||
|
||||
@@ -67,6 +67,10 @@ export default class Mock implements ProviderInterface {
|
||||
this.init();
|
||||
}
|
||||
|
||||
get hasSubscriptions (): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
isConnected (): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ export type ProviderInterface$Emitted = 'connected' | 'disconnected';
|
||||
export type ProviderInterface$EmitCb = (value?: any) => any;
|
||||
|
||||
export interface ProviderInterface {
|
||||
readonly hasSubscriptions: boolean;
|
||||
isConnected (): boolean;
|
||||
on (type: ProviderInterface$Emitted, sub: ProviderInterface$EmitCb): void;
|
||||
send (method: string, params: Array<any>): Promise<any>;
|
||||
|
||||
@@ -95,6 +95,13 @@ export default class WsProvider implements WSProviderInterface {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary `true` when this provider supports subscriptions
|
||||
*/
|
||||
get hasSubscriptions (): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Manually connect
|
||||
* @description The [[WsProvider]] connects automatically by default, however if you decided otherwise, you may
|
||||
|
||||
Reference in New Issue
Block a user