https://github.com/zweifisch/evocatio
https://github.com/zweifisch/evocatio
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zweifisch/evocatio
- Owner: zweifisch
- Created: 2016-02-03T03:41:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-20T14:35:48.000Z (almost 9 years ago)
- Last Synced: 2025-02-28T13:55:44.803Z (3 months ago)
- Language: CoffeeScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# evocatio
[![NPM Version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]```javascript
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
```[npm-image]: https://img.shields.io/npm/v/evocatio.svg?style=flat
[npm-url]: https://npmjs.org/package/evocatio
[travis-image]: https://img.shields.io/travis/zweifisch/evocatio.svg?style=flat
[travis-url]: https://travis-ci.org/zweifisch/evocatio