Closed Akkuma closed 8 years ago
Yeah definitely, been thinking about this too. Would need a getter method that asks for a saved "stash", before unwrapping.
Probably live at this._.files
I don't think you need a getter method. I think all you need is this:
Fly.prototype.source = function (globs) {
globs = arrify(globs);
var flattenedGlobs = flatten(globs);
assign(this, {
_: {
filters: [],
globs: flattenedGlobs,
files: Promise.all(flattenedGlobs.map(expand))
}
});
this._.cat = undefined
_('source %o', this._.globs)
return this
}
in unwrap you now use roughly
Fly.prototype.unwrap = function (onResolved, onRejected) {
this._.files.then(onResolved).catch(onRejected);
}
Yeah, true -- by the time any filter/plugin is called, source()
has already been run... early morning haze 😴
Closed by #189
Currently the code calls
expand
akaglobby
each timeunwrap
is called. It seems like it would be beneficial to eagerly evaluate insource
, so it is done once for eachsource
, rather than multiple times per wrap/target.