christianmalek / vuex-rest-api

A utility to simplify the use of REST APIs with Vuex
http://vuex-rest-api.org
MIT License
382 stars 48 forks source link

Support for Fetch API #93

Closed geiseri closed 4 years ago

geiseri commented 5 years ago

Right now it seems that Axios is not interested in supporting the Fetch API standard. While it is quite new and not widely supported it has several key features for PWAs that help with offline first activities and caching API calls. It also has support for Blobs which are becoming more popular for texture assets. From the API it doesn't look like there are a lot of dependencies on the behaviors of axios, but the API is different enough that it might make it hard to have a drop-in replacement. Thoughts?

christianmalek commented 5 years ago

At the moment the usage of axios is "hard coded" in vuex-rest-api. Of course it would be possible to implement interfaces and make it possible to also use the fetch API. I'll have to research how far this code change would benefit vuex-rest-api.

I'll also consider substituting axios with the fetch API if this makes sense.

geiseri commented 5 years ago

I did a cursory look and it seemed like it might be a bit more invasive. On the plus side with a polyfill Fetch could become the default and no lose any browser support. The key thing I need would be the ability to support offline and background sync.

christianmalek commented 5 years ago

Thanks for your additional feedback.

christianmalek commented 4 years ago

I'll close this. Feel free to open it again.