Skip to content

Instantly share code, notes, and snippets.

@saml
Created May 12, 2020 13:22
Show Gist options
  • Save saml/9a33deb9711385062ee4143ad3c676f8 to your computer and use it in GitHub Desktop.
Save saml/9a33deb9711385062ee4143ad3c676f8 to your computer and use it in GitHub Desktop.
async (next) => {
const x = await f1();
if (x) {
return next();
}
f2(() => {
f3();
next();
});
// fails eslint consistent-return
}
async (next) => {
const x = await f1();
if (x) {
return next();
}
await new Promise((resolve) => {
f2(() => {
f3();
resolve();
});
});
return next(); // passes eslint
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment