evem.mjs

  1. import EventEmitter from 'eventemitter3'
  2. /**
  3. * EventEmitter from eventemitter3
  4. *
  5. * See: {@link https://github.com/primus/eventemitter3 eventemitter3}
  6. *
  7. * Unit Test: {@link https://github.com/yuda-lyu/wsemi/blob/master/test/evem.test.mjs Github}
  8. * @memberOf wsemi
  9. * @example
  10. *
  11. * let ev = wsemi.evem()
  12. * ev.on('evName',function(msg){
  13. * console.log(msg)
  14. * // => {abc: 12.34}
  15. * })
  16. * let data = {abc:12.34}
  17. * ev.emit('evName',data)
  18. *
  19. */
  20. function evem() {
  21. return new EventEmitter()
  22. }
  23. export default evem