evocatio
v0.0.4
Published
[![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
Downloads
5
Readme
evocatio
fns = require("evocatio")();
fns.register("whoami", => "nobody");
fns.register("context", function(){
return this.id;
});
fns.register("namespace.async", {
operation: function*(arg, more){
yield asyncoperation(arg);
}
});
fns.dispatch("whoami", {}); // "nobody"
fns.dispatch("context", {}, {id: "2"}); // "2"
fns.dispatch("namespace.async.operation", {arg: null, more: false}); // promise