Open tunnckoCore opened 5 years ago
helper(prop, fn) {
if (utils.isObject(prop)) {
this.helpers(prop);
} else {
this.asyncHelpers.set(prop, fn);
}
return this;
}
helpers(helpers) {
this.asyncHelpers.set(helpers);
return this;
}
// later merge `this.imports` and `this.asyncHelpers.helpers`
Probably would be good thing to just rename the this.helpers
in async-helpers
to be this.imports
so will be able to extend
the AsyncHelpers class here.
Will be good to support it out of the box.
With https://github.com/doowb/async-helpers/pull/19 it will be nothing more than just calling its
.set
. If the helper is regular async or callback async function it will be handled/wrapped by theasync-helpers
, otherwise it will be just set in thethis.helpers
. With.get()
you will get both the wrapped and non-wrapped ones.