node-rate-limiter-flexible icon indicating copy to clipboard operation
node-rate-limiter-flexible copied to clipboard

chore: Prefer async functions

Open mroderick opened this issue 2 years ago • 2 comments

Since the codebase already uses async/await and requires node 14+, it might as well use async/await instead of then for Promises

By using async/await we can reduce the indentation levels, which generally makes the code easier to understand.

If refactoring like this is welcome, then I will expand on this PR to tidy up the test file and the source file it tests. Future PRs can tidy up other file pairs.

mroderick avatar Dec 23 '23 21:12 mroderick

@mroderick Hey, refactoring is always welcome. Thank you for all the PRs you made recently. They are all valuable.

animir avatar Dec 24 '23 12:12 animir

@mroderick Hey, refactoring is always welcome. Thank you for all the PRs you made recently. They are all valuable.

OK, then I'll add more to this PR. Setting it back to draft :)

mroderick avatar Dec 25 '23 15:12 mroderick