fix index typo
This commit is contained in:
@ -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);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user