mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-21 10:02:57 +00:00
Move EventStream to external module
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
const Stream = new EventEmitter;
|
||||
|
||||
export default {
|
||||
emit : function(event) {return Stream.emit(event, ...([...arguments].slice(1)));}, // Arguments doesn't work for arrow functions
|
||||
on : (event, listener)=>{return Stream.on(event, listener);},
|
||||
off : (event, listener)=>{return Stream.off(event, listener);}
|
||||
};
|
||||
Reference in New Issue
Block a user