Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is this tool a replcaement of asyncWrapper ? #49

Open
issam-seghir opened this issue Feb 11, 2024 · 1 comment
Open

is this tool a replcaement of asyncWrapper ? #49

issam-seghir opened this issue Feb 11, 2024 · 1 comment

Comments

@issam-seghir
Copy link

is this tool a replacement of this :

function asyncWrapper(fn) {
	return function (req, res, next) {
		fn(req, res, next).catch(next);
	};
}


  app.get('/route', asyncWrapper(async (req, res, next) => {
  const data = await someAsyncOperation();
  res.json(data);
  }));
@AlanGreyjoy
Copy link

yes. stop doing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants