πwebln.off()
Method
function off(eventName: "accountChanged", listener: () => void): void;Code Example
if (!webln.on) { alert('not supported'); }
await webln.enable();
// subscribe to the accountChanged event
webln.on("accountChanged", accountChangedHandler); // callback is executed once account is changed in provided with multiple accounts
// use .off() to unsubscribe from the event.
webln.off("accountChanged", accountChangedHandler);
function accountChangedHandler() {
console.log("Account Changed!");
}
Last updated
Was this helpful?