Allow res to be passed as orm callback for standard usage #282

Closed
mikermcneil opened this Issue Apr 1, 2013 · 1 comment

Comments

2 participants
Owner

mikermcneil commented Apr 1, 2013

In your controllers, instead of:

User.findAll().done(function (err, users) {
  if (err) res.send(err,500);
  else if (res.viewExists) res.view({ models: users });
  else res.json(users);
});

You'd be able to do:

User.findAll().done(res);

Which can actually be optimized internally to:

User.stream().pipe(res);

CWyrtzen commented May 8, 2014

Noted~

@CWyrtzen CWyrtzen closed this May 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment