earthstar-project / earthstar

Storage for private, distributed, offline-first applications.
https://earthstar-project.org
GNU Lesser General Public License v3.0
637 stars 20 forks source link

Peer should be an EventTarget and emit events #342

Open sgwilym opened 4 months ago

sgwilym commented 4 months ago

What's the problem you want solved?

There is no way to observe when certain changes have taken place to a Peer without being directly responsible for those changes yourself.

Is there a solution you'd like to recommend?

Peer should extend EventTarget and should be able to pass on events from its underlying Auth (#341), and for when a new share becomes available thanks to the addition of a capability.