You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the http.Client is completely managed by the constructor , and is unexported preventing any further configuration of the client after initialization
However, it may be desirable to provide a customized client to the library in order to support additional features like:
Currently the
http.Client
is completely managed by the constructor , and is unexported preventing any further configuration of the client after initializationHowever, it may be desirable to provide a customized client to the library in order to support additional features like:
There's a couple methods to solve, each with their own pros and cons
With a breaking change we could inject the client into the constructor:
At the risk of a user modifying the client midflight, we could export the client field:
To maintain backwards compatibility, we could add variadic, functional parameters:
Which could look like this:
Given that apiKey is optional, it may be interesting to move to a new constructor signature to allow it to be omitted:
Let me know what you think, and if I can help
The text was updated successfully, but these errors were encountered: