All files / piscosour/lib bus.js

50% Statements 4/8
100% Branches 0/0
100% Functions 0/0
50% Lines 4/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22    1x   1x 1x                               1x
'use strict';
 
const EventEmitter = require('events');
 
const _bus = Symbol('_bus');
const bus = {
 
  [_bus]: Object.create(new EventEmitter()),
 
  emit() {
    this[_bus].emit.apply(this[_bus], arguments);
    return this;
  },
 
  on() {
    this[_bus].on.apply(this[_bus], arguments);
    return this;
  }
 
};
 
module.exports = bus;