-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Client class in favor of direct axios instance #6
Comments
Let's go ahead and try this. I suspect you are right about everything you've said. I'm a bit uncomfortable with having Axios be part of the interface of multinetjs, but my metabrain says I'm uncomfortable about nothing. When you do this change, try to keep it minimal to just changing out the Thanks, @AlmightyYakob, good thinking on this. |
So for the initial change, should I preserve functionality on |
Yes I believe so. Using axios instead of the Client class shouldn't change the library interface right? |
No it shouldn't, but there's really two issues I proposed, one being using the client class, the other being the extraction of the return values. I'm not sure how you feel about the second point, but I can start the first one without issue. |
Ah gotcha. Yeah we will need to have a deeper discussion about that second point because the intent of multinetjs is to provide a simple interface to the API. I'll have to hear about why the request transport mechanism needs to be exposed, etc., before we decide on that breaking change. |
This has been a source of pain for me several times in the past. I don't see a real reason to wrap calls with the
Client
class withinmultinetjs
itself. The result of having this abstraction is less flexibility (as you can't just pass any axios parameters into the exposed API methods), which results in both more changes/releases tomultinetjs
, as well as workarounds.I think we should remove the
Client
field in theMultinetAPI
class altogether, and replace it with anaxios
instance. Along with this, we should have a parameter in each function that accepts an AxiosRequestConfig object, which we could just pass to the axios call, allowing more flexibility and lessmultinetjs
releases.The other benefit of replacing these wrapping calls with axios calls directly, is that the client can have access to the details of the request. This can be useful for several reasons, and has already been required in the project. This would result in a breaking change to
multinetjs
however, so if we were to move forward with this, we'd have to coordinate with that repository as well.I believe I've already discussed this somewhat with @waxlamp, but I've again run into roadblocks as a result of this, so that's why I'm raising this issue now. I'm willing to do much of the work required for this, but I want to make sure we're in agreement first. Please let me know what you think.
The text was updated successfully, but these errors were encountered: