Improve events (#454)
* Fix typo in docs * Improve events Expose `error` event Add `once` Allow method chaining for `on` and `once`
This commit is contained in:
committed by
Jaco Greeff
parent
dd9c5ee5e2
commit
7b667cfb9f
@@ -3,6 +3,7 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { ReplaySubject, Observable } from 'rxjs';
|
||||
import { ProviderInterface$Emitted } from '@polkadot/rpc-provider/types';
|
||||
|
||||
export type RpcRxInterface$Method = (...params: Array<any>) => Observable<any> | ReplaySubject<any>;
|
||||
|
||||
@@ -10,7 +11,7 @@ export type RpcRxInterface$Section = {
|
||||
[index: string]: RpcRxInterface$Method
|
||||
};
|
||||
|
||||
export type RpcRxInterface$Events = 'connected' | 'disconnected';
|
||||
export type RpcRxInterface$Events = ProviderInterface$Emitted;
|
||||
|
||||
export type RpcRxInterface = {
|
||||
readonly author: RpcRxInterface$Section;
|
||||
|
||||
Reference in New Issue
Block a user