Task observer for aster.
This module is part of aster and is available via aster.runner.
You use it in build scripts whenever you want build pipeline (which is lazy by default) to be executed:
var aster = require('aster');
aster.src('src/**/*.js')
.map(plugin1(optionsForPlugin1))
.map(plugin2(optionsForPlugin2))
// ...
.subscribe(aster.runner({
onNext: (item) => {
console.log('>> %s'.yellow, item)
}
}));When you create an Observable, you always pass 3 functions in this order:
successHandlererrorHandleronCompleteHandler
The success or error handler is called for each processed event/item of the Observable stream, the onComplete handler when the stream is done (such as no more files to be processed).
The default event handlers are:
function onFile(file) {
console.log('>> %s'.yellow, file.path)
}
function onError(error) {
console.error(error.stack.red)
}
function onCompleted() {
console.log('Done.'.green)
}Where onFile is used for onSuccess and expects a file object with a path.
Type: Rx.Observer
Success event handler for individual item/event processed.
Error event handler for individual item/event processed.
Completed handler for when entire stream of events/items of Observable has been processed.

