evtbus

Combination of an in-process 'event bus' and a streamlined event emitter

Usage no npm install needed!

<script type="module">
  import evtbus from 'https://cdn.skypack.dev/evtbus';
</script>

README

evtbus

Combination of an in-process "event bus" and a streamlined event emitter (e.g. mitt)

Example

import eb from 'evtbus'

eb.sink(this).subscribe('topic', 'event', evt => console.log('on topic event', evt))
eb.sink(this).clear()

const topic = eb.topic('my-topic')
topic.emit('event', {info: 1942})
topic.clear()