Skip to content

Commit

Permalink
perf: minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Jan 26, 2018
1 parent 6f6f7bc commit e4083aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export default class Hookable {
return
}

this.$hooks[name] = this.$hooks[name] || []
if (!this.$hooks[name]) {
this.$hooks[name] = []
}

this.$hooks[name].push(fn)
}

Expand Down

0 comments on commit e4083aa

Please sign in to comment.