2.5 KiB
2.5 KiB
name: RpcRx
summary: The RxJS API is a wrapper around the API.
description: It allows wrapping API components with observables using RxJS.
example:
import RpcRx from '@polkadot/rpc-rx';
import WsProvider from '@polkadot/rpc-provider/ws';
const provider = new WsProvider('http://127.0.0.1:9944');
const api = new RpcRx(provider);
Hierarchy
RpcRx
Implements
object
Constructors
constructor
⊕ new RpcRx(providerOrRpc?: Rpc | ProviderInterface): RpcRx
Defined in index.ts:39
Parameters:
| Name | Type |
|---|---|
Optional providerOrRpc |
Rpc |
Returns: RpcRx
Properties
author
● author: RpcRxInterface$Section
Defined in index.ts:36
chain
● chain: RpcRxInterface$Section
Defined in index.ts:37
state
● state: RpcRxInterface$Section
Defined in index.ts:38
system
● system: RpcRxInterface$Section
Defined in index.ts:39
Methods
isConnected
▸ isConnected(): BehaviorSubject<boolean>
Defined in index.ts:59
Returns: BehaviorSubject<boolean>
on
▸ on(type: RpcRxInterface$Events, handler: function): void
Defined in index.ts:63
Parameters:
| Name | Type |
|---|---|
| type | RpcRxInterface$Events |
| handler | function |
Returns: void