import { ApiPromise } from "https://deno.land/x/polkadot@0.2.27/api/index.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
An array of function to combine, each in the form of (cb: (value: void)) => void
callback: CombinatorCallback<T>
A callback that will return an Array of all the values this combinator has been applied to