logoalt Hacker News

seertoday at 3:51 AM2 repliesview on HN

Also it has interceptors, which allow you to build easily reusable pieces of code - loggers, oauth, retriers, execution time trackers etc.

These are so much better than the interface fetch offers you, unfortunately.


Replies

reactordevtoday at 3:58 AM

You can do all of that in fetch really easily with the init object.

   fetch('https://api.example.com/data', {
  headers: {
    'Authorization': 'Bearer ' + accessToken
  }
})
show 2 replies
meekinstoday at 4:03 AM

It also supports proxies which is important to some corporate back-end scenarios

show 1 reply