Skip to content

Commit

Permalink
Expand sample
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Oct 19, 2018
1 parent ac04545 commit 473f67c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/api/src/promise/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,15 @@ export default class ApiPromise extends ApiBase<Rpc, QueryableStorage, Submittab
* <BR>
*
* ```javascript
* const address = '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFacT7';
*
* // combines values from balance & nonce as it updates
* api.combine([
* (cb) => api.query.balances.freeBalance(<address>, cb),
* (cb) => api.query.system.accountNonce(<address>, cb)
* ], ([balance, nonce]) => {
* console.log(`You have ${balance} units, with ${nonce} transactions sent`);
* (cb) => api.rpc.chain.subscribeNewHead(cb),
* (cb) => api.query.balances.freeBalance(address, cb),
* (cb) => api.query.system.accountNonce(address, cb)
* ], ([head, balance, nonce]) => {
* console.log(`#${head.number}: You have ${balance} units, with ${nonce} transactions sent`);
* });
* ```
*/
Expand Down

0 comments on commit 473f67c

Please sign in to comment.