fix index typo

This commit is contained in:
atomiks
2018-01-06 00:26:30 +11:00
committed by GitHub
parent 4c0cce5824
commit 39e096055a

View File

@ -22,7 +22,7 @@ const createEventHub = () => ({
},
off(event, 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);
}
});
```