Thunkify rethinkdb
To be used with co and/or koa.
So that we can do something like:
var r = require('rethunkdb') // not a typo, might use other name if too close :)
, koa = require('koa')
, app = koa();
app.use(function *(next) {
if (!this.app.rdb) this.app.rdb = yield r.connect();
yield next;
});
app.use(function *() {
this.body = yield r.run(this.app.rdb, r.table('animals').get('cat'));
});
app.listen(3000);
NOT YET TESTED