Comparing version 0.0.5 to 0.0.6
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="0.0.6"></a> | ||
## [0.0.6](https://github.com/pi0/hable/compare/v0.0.5...v0.0.6) (2018-01-26) | ||
### Performance Improvements | ||
* reduce transpiled dist size ([df607cf](https://github.com/pi0/hable/commit/df607cf)) | ||
<a name="0.0.5"></a> | ||
@@ -7,0 +17,0 @@ ## [0.0.5](https://github.com/pi0/hable/compare/v0.0.4...v0.0.5) (2018-01-26) |
@@ -30,14 +30,6 @@ 'use strict'; | ||
return new Promise(function ($return, $error) { | ||
if (!this.$hooks[name]) { | ||
return $return(); | ||
} | ||
return Promise.resolve(lib_1(this.$hooks[name], function (fn) { return fn.apply(void 0, args); })).then(function ($await_1) { | ||
try { | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this)); | ||
if (!this.$hooks[name]) { | ||
return; | ||
} | ||
return lib_1(this.$hooks[name], function (fn) { return fn.apply(fn, args); }); | ||
}; | ||
@@ -49,14 +41,6 @@ | ||
return new Promise(function ($return, $error) { | ||
if (!this.$hooks[name]) { | ||
return $return(); | ||
} | ||
return Promise.resolve(lib_2(this.$hooks[name], function (fn) { return fn.apply(void 0, args); })).then(function ($await_2) { | ||
try { | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this)); | ||
if (!this.$hooks[name]) { | ||
return; | ||
} | ||
return lib_2(this.$hooks[name], function (fn) { return fn.apply(fn, args); }); | ||
}; | ||
@@ -63,0 +47,0 @@ |
@@ -28,14 +28,6 @@ function serial(tasks, fn) { | ||
return new Promise(function ($return, $error) { | ||
if (!this.$hooks[name]) { | ||
return $return(); | ||
} | ||
return Promise.resolve(lib_1(this.$hooks[name], function (fn) { return fn.apply(void 0, args); })).then(function ($await_1) { | ||
try { | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this)); | ||
if (!this.$hooks[name]) { | ||
return; | ||
} | ||
return lib_1(this.$hooks[name], function (fn) { return fn.apply(fn, args); }); | ||
}; | ||
@@ -47,14 +39,6 @@ | ||
return new Promise(function ($return, $error) { | ||
if (!this.$hooks[name]) { | ||
return $return(); | ||
} | ||
return Promise.resolve(lib_2(this.$hooks[name], function (fn) { return fn.apply(void 0, args); })).then(function ($await_2) { | ||
try { | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this)); | ||
if (!this.$hooks[name]) { | ||
return; | ||
} | ||
return lib_2(this.$hooks[name], function (fn) { return fn.apply(fn, args); }); | ||
}; | ||
@@ -61,0 +45,0 @@ |
{ | ||
"name": "hable", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "A simpler tapable alternative, which can be used to create hooks for plugins", | ||
@@ -5,0 +5,0 @@ "main": "dist/hable.cjs.js", |
@@ -11,14 +11,14 @@ import { serial, parallel } from 'items-promise' | ||
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)) | ||
} | ||
@@ -25,0 +25,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114904
145