milu

1.1.2 • Public • Published

milu

build status

“麋鹿”

Install

npm install milu

Usage

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) {
  // ...
});

LICENSE

MIT

Dependents (2)

Package Sidebar

Install

npm i milu

Weekly Downloads

6

Version

1.1.2

License

MIT

Last publish

Collaborators

  • nqdeng