Hacker News new | past | comments | ask | show | jobs | submit login

> I suppose it doesn't get rid of callbacks, just makes them readable.

You are the one who stated generators were no solution to callback hell but async/await was, yet here's what your code looks like with generators:

    app.get('/thing', function* (req, res) {
        try {
            let user = yield* db.get({user: req.user});
            res.send({user: user});
        } catch {
            res.send(400);
        }
    });
...



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: