fix index typo

This commit is contained in:
atomiks
2018-01-06 00:26:30 +11:00
committed by GitHub
parent c2140cb3aa
commit 9f7fc75c4f

View File

@ -22,7 +22,7 @@ const createEventHub = () => ({
}, },
off(event, handler) { off(event, handler) {
const i = this.hub[event].findIndex(h => h === handler); const i = this.hub[event].findIndex(h => h === handler);
if (i) this.hub[event].splice(i, 1); if (i > -1) this.hub[event].splice(i, 1);
} }
}); });
``` ```