jemmyphan / supafetch

This project is unmaintained now. I recommend using https://github.com/niftylettuce/frisbee since it's better in many ways
Apache License 2.0
4 stars 0 forks source link

export Supafetch class? #2

Open someone1 opened 6 years ago

someone1 commented 6 years ago

I'd like to be able to create instances of this class instead of relying on a single globally shared instance. Axios has similar functionality and it's useful in scenarios where I have multiple APIs I want to interact with and they have different authentication. I can set default headers and such per-instance instead of trying to have my API calls explicitly specify the headers per-call or wrap the supafetch object myself to add these. This is also helpful where I want to keep the default instance pure, for instance as a public client where I never want to leak a credential.