Skip to content

Commit

Permalink
fix(): tests
Browse files Browse the repository at this point in the history
  • Loading branch information
crobinson42 committed Apr 25, 2017
1 parent 88320e9 commit 30f1a12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class EventSky {
this.beforeAll = this._utils.curryWhenHandler.bind(this)('beforeAll')
this.afterAll = this._utils.curryWhenHandler.bind(this)('afterAll')

// bind methods
this.off = this.off.bind(this)
this.trigger = this.trigger.bind(this)

// extend a chain call for eventSky.off.all()
this.off.all = this.allOff.bind(this)
}
Expand All @@ -30,7 +34,7 @@ class EventSky {
* @param handler
* @returns {EventSky}
*/
off = (eventOrId, handler) => {
off (eventOrId, handler) {
// iterate all events by names
Object.keys(this.events).forEach(_eventName => {
// iterate each 'when' event lifecycle and look for eventId or handler to remove
Expand Down Expand Up @@ -66,7 +70,7 @@ class EventSky {
* @param eventName {string} the name of the event
* @returns {EventSky}
*/
allOff = (event) => {
allOff (event) {
delete this.events[event]

this._firehose(`.off.all("${event}") removed all event handlers`)
Expand All @@ -76,7 +80,7 @@ class EventSky {
return this
}

trigger = (event, data) => {
trigger (event, data) {
if (!this._utils.validateEventName(this, event)) return this

if (!this.events[event]) {
Expand Down
File renamed without changes.

0 comments on commit 30f1a12

Please sign in to comment.