1.1.2 • Published 9 years ago
milu v1.1.2
milu
“麋鹿”
Install
npm install miluUsage
var milu = require('milu');
var verb = {
  is: function (type) {
    return function *(next) {
      if (this.type === type) {
        yield next;
      }
    };
  },
  say: function (word) {
    return function *(next) {
      console.log(word);
    };
  },
};
var root = milu(verb);
root.is('cat').then
    .say('miao')
    .end
  .is('dog').then
    .say('wang')
    .end;
root.run({ type: 'cat' }, function (err) {
  // ...
});