import Event from 'geval/event';

export default superclass => class extends superclass {
  get events() {
    return this._events;
  }

  set events(list) {
    this._broadcast = {};
    this._events = {};
    for (let name of list) {
      const ev = new Event();
      this._events[name] = ev.listen;
      this._broadcast[name] = ev.broadcast;
    }
  }
};
