ran npm run tdd

This commit is contained in:
King
2018-01-17 13:40:40 -05:00
parent 207a6d79e0
commit 69abf1b863
244 changed files with 894 additions and 371 deletions

View File

@ -1,4 +1,4 @@
module.exports = createEventHub = () => ({
const createEventHub = () => ({
hub: Object.create(null),
emit(event, data) {
(this.hub[event] || []).forEach(handler => handler(data));
@ -11,4 +11,5 @@ off(event, handler) {
const i = (this.hub[event] || []).findIndex(h => h === handler);
if (i > -1) this.hub[event].splice(i, 1);
}
});
});
module.exports = createEventHub