I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Reply To: Adding a knockout.js data binding on the balance template

dashed-slug.net Forums General discussion Adding a knockout.js data binding on the balance template Reply To: Adding a knockout.js data binding on the balance template

#11457
alexg
Keymaster

If you want to hook into an event, you could subscribe to the observable for the selected currency:

wp.wallets.viewModels.wallets.selectedCoin.subscribe(
  function() {
    let coin = wp.wallets.viewModels.wallets.coins()[ wp.wallets.viewModels.wallets.selectedCoin() ];
    let html = '<span class="button" href="?symbol=' + coin.symbol + '&balance=' + coin.balance + '">' + coin.name + '</span>';
    console.log( html);
  }
);

Not sure if this is what you are looking for. Again sorry, I know all of this is confusing, which is why I am currently improving it.