Skip to content

Commit

Permalink
perf: reduce transpiled dist size
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Jan 26, 2018
1 parent fb51c14 commit df607cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ export default class Hookable {
this.hookObj = this.hookObj.bind(this)
}

async callHook(name, ...args) {
callHook(name, ...args) {
if (!this.$hooks[name]) {
return
}
await serial(this.$hooks[name], fn => fn(...args))
return serial(this.$hooks[name], fn => fn.apply(fn, args))
}

async callHookAsync(name, ...args) {
callHookAsync(name, ...args) {
if (!this.$hooks[name]) {
return
}
await parallel(this.$hooks[name], fn => fn(...args))
return parallel(this.$hooks[name], fn => fn.apply(fn, args))
}

hook(name, fn) {
Expand Down

0 comments on commit df607cf

Please sign in to comment.