Update createEventHub.md

This commit is contained in:
atomiks
2018-01-06 00:18:41 +11:00
committed by GitHub
parent 3ac45b6be3
commit c2140cb3aa

View File

@ -8,7 +8,7 @@ each one with `Array.forEach()` by passing in the data as an argument.
For `on`, create an array for the event if it does not yet exist, then use `Array.push()` to add the handler
to the array.
For `off`, use `Array.findIndex()` to find the index of the handler in the event array and remove it.
For `off`, use `Array.findIndex()` to find the index of the handler in the event array and remove it using `Array.splice()`.
```js
const createEventHub = () => ({