- Fetch and Promises start executing immediately. You cannot create a Promise object and store it to be executed later. If you are trying to avoid that, one option is to create a function that returns the Promise when needed.
- Fetch requests have no concept of a timeout. If you need a Fetch request to be aborted after a certain number of seconds, the best way I have seen is to use Promise.race along with a different function that then throws the error to reject the Promise chain.
- Making multiple calls with Fetch? Promise.all is a great option except that all requests / Promises start executing in parallel. If you need to execute them in sequence (like I did), you are out of luck without writing some utility code or leveraging a library. I ended up using this npm module.
- Server error responses to Fetch calls are still interpreted as successes and call the success callback handler. Which means that you have to check for errors in your onSuccess which feels just wrong.
These are definitely some … debatable calls made by the guys deciding the api. If there are other gotchas you have run into, please share them here as well.