Is it correct to be typing queryMulti
return types such as in the following example, providing the types at the function call rather than inside the callback params? (For brevity I have used any
for concrete return types):
const unsub: () => void = await api.queryMulti<
[any, Option<any>, Option<any>]
>(
[
[api.query.system.account, address],
[api.query.staking.bonded, address],
[api.query.staking.nominators, address],
],
async ([{ data }, bonded, nominations]): Promise<void> => {
const _account: any = {
address,
};
Note: An awesome update to the Polkadot JS API docs would be to be able to toggle between JavaScript and TypeScript for each of the examples, providing fully typed use cases and prevent developers from having to browse the PJS Apps codebase.