i try to subscribe a account change event by code follow document https://polkadot.js.org/docs/api/start/api.query.subs
const unsub = api.query.system.account(address, (acc) => console.log);
it tells the unsub will be a UnsubscribePromise type. but it actully return Promise<Codec> type.
how can i get the UnsubscribePromise Type to unsubscribe it.
update
i wrote a demo code
and try to compile it.
➜ sub git:(master) pnpm build
> [email protected] build /srv/tmp/sub
> tsc && vite build
src/pok/pok.ts:6:53 - error TS7006: Parameter 'acc' implicitly has an 'any' type.
6 const unsub = await api.query.system.account('',acc =>console.log);
~~~
src/pok/pok.ts:10:5 - error TS2349: This expression is not callable.
Type 'Codec' has no call signatures.
10 unsub()
~~~~~
Found 2 errors in the same file, starting at: src/pok/pok.ts:6
ELIFECYCLE Command failed with exit code 2.
it tells me Type 'Codec' has no call signatures.
update 2
i make a workspace on gitpod
it can show the error message on terminel tab.