update to allow passing args to tap
This update allows the passing of an argument variable through to the lambda method. The argument can be a single value, array, or object - it is naively passed to the lambda. This addresses issue #17.
function myFunc(file, t, n, arg) {
// arg === { t: 1 }
}
// gulp pipe omitted ...
tap(myFunc, { t: 1 })
Updated to also allow this:
function myFunc(file, t, n, arg, arg2, arg3) {
// arg === { t: 1 }
// arg2 === "foo"
// arg3 === "bar"
}
// gulp pipe omitted ...
tap(myFunc, { t: 1 }, "foo", "bar")
@patrick-rodgers Thank you very much for your contribution. Will you please add two tests for this?
Bonus if you have a use-case you can link to so we can put it in the wiki and write about the motivation for this feature in the next release.
Thanks
Added the tests to cover calling tap with 0, 1, or 2 args. As for a usecase you can have a look at where I used it in a task to build docs. I needed to grab the header and footer for each article and wanted to only get them once to pass them on to the function to create the html article.
Oh, and all the tests pass, but please do have a look as CoffeeScript is new to me so always possible I am not actually calling anything :)