I mean look at it, it's really clean, except for the anonymous callback pattern.
Yet maybe I'm missing something here. Take a look at the following snippet:
Take a minute and think about it. This enables you to make command line tools that do whatever you want!
Even better, what if you used a functional composition library like... say...
Composer.js
?So this is really cool, and make your own judgements, but you can do some interesting things with it. For example, remember that
this
is the object that composer is making, right? See the following.That was fun! Sure it may not be the best way to build your gulp tasks, but surely this allows for mix and match DRY task factories.
Are you going to use it? I'd say get back to writing fun code ;).
In functional health,
~function(){console.log(this)}.call("Josh");
"Josh"
P.S. Don't forget about
Composer.symphony
Edit:
This example shows the sheer power of symphony which give you DRY tasks given a good configuration. Watch out though, because
this
is a Object.create
d version of gulp.
No comments:
Post a Comment