tunnckoCore / ideas

:notebook: My centralized place for ideas, thoughts and todos. Raw, PoC implementations and so on... :star:
http://j.mp/1stW47C
6 stars 0 forks source link

tasker - task runner on 13 lines (simply based on `letta@0.6`) #31

Open tunnckoCore opened 8 years ago

tunnckoCore commented 8 years ago
tasker.tasks = {}
tasker.task = tasker
function tasker (name, fn) {
  tasker.tasks[name] = fn
  return {
    task: tasker,
    run: run
  }
}
function run (name, callback) {
  var task = tasker.tasks[name]
  var promise = letta.call(tasker, task)
  return thenCallback(promise).then(callback)
}
tunnckoCore commented 8 years ago

It won't use async-control. It should be based only on letta@0.6+ and look like mukla and assertit - even maybe compatible with them.

ref: #11 (Erasm, gulp@3 compatible task runner)