A lightweight es6 PubSub class (Singleton).
import PubSub from './PubSub.js';
const topic = PubSub.subscribe( 'event', callback );
// or if you don't need to unsubscribe
PubSub.subscribe('event', callback)
PubSub.publish('event', {data})
PubSub.unsubscribe(topic );