whatwg / compression

Compression Standard
https://compression.spec.whatwg.org/
Other
82 stars 21 forks source link

In example code, simply return the promise from Response.blob. #23

Closed jeremyroman closed 4 years ago

jeremyroman commented 4 years ago

It's unnecessary to await a promise returned from an async function (except if, as not needed here, the exception is to be caught in this function instead of by a caller).

It's slightly verbose and advised against: https://github.com/eslint/eslint/blob/master/docs/rules/no-return-await.md https://jakearchibald.com/2017/await-vs-return-vs-return-await/

Since this is the only use of await, this function is not actually async. Finally, it should be named with the same casing convention as the previous example.


Preview | Diff

jeremyroman commented 4 years ago

This is basically a pile of nits. :)