import { api } from "https://deno.land/x/polkadot@0.2.27/mod.ts";
const { ApiRx } = api;
Examples
import { switchMap } from 'https://esm.sh/rxjs@7.8.0';
import Api from 'https://deno.land/x/polkadot@0.2.27/api/rx/index.ts';
Api.create()
.pipe(
switchMap((api) =>
api.rpc.chain.subscribeNewHeads()
))
.subscribe((header) => {
console.log(`new block #${header.number.toNumber()}`);
});