ferment
Version:
Peer-to-peer audio publishing and streaming application. Like SoundCloud but decentralized. A mashup of ssb, webtorrent and electron.
14 lines (13 loc) • 363 B
JavaScript
module.exports = function watchEvent (source, event, listener) {
if (source.on) {
source.on(event, listener)
return function () {
source.removeListener(event, listener)
}
} else if (source.addEventListener) {
source.addEventListener(event, listener)
return function () {
source.removeEventListener(event, listener)
}
}
}