nolanlawson / blob-util

Cross-browser utils for working with binary Blobs
https://nolanlawson.github.io/blob-util
Apache License 2.0
503 stars 45 forks source link

promises #35

Closed lstkz closed 7 years ago

lstkz commented 7 years ago

Almost all API methods return a promise even if the whole code is synchronous. Is there any reason why force to use promises?

In my current code, I had a forEach loop, and I had to refactor it to Promise.map and use async/await. I think it's not a good practice to wrap everything in promises. A synchronous code is always easier to read than asynchronous.

nolanlawson commented 7 years ago

I find it simpler that every API returns a promise and you don't have to remember which ones do and which ones won't.