SpoonX / aurelia-api

A simple convenience wrapper around aurelia-fetch-client
http://aurelia-api.spoonx.org
MIT License
72 stars 21 forks source link

Config coupled to aurelia-fetch-client #206

Closed MarcScheib closed 6 years ago

MarcScheib commented 6 years ago

Hey guys,

I am currently trying to test my app using the aurelia-http-client-mock. Therefore, I register the Mock for HttpClient. However, the aurelia-api Config is currently coupled to aurelia-fetch-client and, therefore, I can't replace the HTTP client.

Are there any reasons this is coupled at the moment? Any plans to change this?

Best Regards

MarcScheib commented 6 years ago

I was playing a little bit around and it would be possible to get rid of new HttpClient() with a factory for this. However, this requires registering the client as transient (i.e. by the user to don't couple it again in this plugin).

But atm, it seems like the mock lib is for the non-fetch version only.

RWOverdijk commented 6 years ago

@MarcScheib No reason. It started with support for one, and then added the other with BC. We're open to PRs :)

doktordirk commented 6 years ago

it's not only the config which is coupled. allowing old-stlye http request would double the code without much gain. hence i dont think it'll be a good idea

RWOverdijk commented 6 years ago

Closing this for now. If this is still relevant, feel free to reopen the issue.

Note: this is a copy-paste comment to clean up the issues. It's not personal, and I didn't review the issue before posting this. They're all outdated and I need a way to figure out what's still relevant.

Thank you for understanding :)