import { ApiPromise } from "https://dotland.deno.dev/x/polkadot@0.2.38/api/mod.ts";
Examples
const address = '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFacT7';
// combines values from balance & nonce as it updates
api.combineLatest([
api.rpc.chain.subscribeNewHeads,
(cb) => api.query.system.account(address, cb)
], ([head, [balance, nonce]]) => {
console.log(`#${head.number}: You have ${balance.free} units, with ${nonce} transactions sent`);
});
Parameters
callback: CombinatorCallback<T>
A callback that will return an Array of all the values this combinator has been applied to