News for hackers. Stuff that matters.
Re:JavaScript's world domination by tracker1 on Wednesday March 25, 2015 @03:38AM (#9261671)
With BabelJS, or the co modules (used with generators) you can get a very similar model...

    app.use(function *(){
      var db = yeild getDbConnection();
      var data = db.query("procname", this.request.query.param);
      this.body = JSON.stringify(data);
    });
This of course assumes you have a db interface that uses Primises and are using koa for your web platform in a version of node that supports Generators, or are using something like BabelJS or traceur.

There are no comments on this comment yet.