WebBTC / webln-types

Type definitions for WebLN
MIT License
9 stars 4 forks source link

add .on() method to webln for events #6

Open rolznz opened 11 months ago

rolznz commented 11 months ago
bumi commented 11 months ago

for what is the webln:enabled event?

either you call .enable() or you can call isEnabled() - as per the other issue.

what do you need the webln:enabled for?

rolznz commented 11 months ago

@bumi

Example: Bitcoin connect does not know if webln.enable() is called from another part of the website than includes it. It probably shouldn't have to poll isEnabled.

rolznz commented 11 months ago

Update: webln provider should fire webln:enabled to the window/document. It shouldn't be a method on webln (window.webln might not even exist, then how can we subscribe?)