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:
Xiliang Chen
2018-12-10 10:46:04 +01:00
committed by Jaco Greeff
parent dd9c5ee5e2
commit 7b667cfb9f
5 changed files with 44 additions and 9 deletions
+2 -1
View File
@@ -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;