ex_gram
ex_gram copied to clipboard
Tesla configuration too general
If I configure this:
config :tesla, adapter: {Tesla.Adapter.Finch, name: ContaBot.Finch}
It's ok because it's using ContaBot.Finch
from the point of view of ExGram, BUT if I add other dependencies that are using another different Tesla adapter by default or even worse, the same Finch but with a different process... it's starting to depend on ContaBot.Finch
because of the configuration.
Could we change that for:
config :ex_gram, tesla_adapter: {Tesla.Adapter.Finch, name: ContaBot.Finch}
This way it could be configured inside ExGram.Adapter.Tesla
using the adapter
macro and it releases the dependency for the rest of the dependencies also using Tesla.
What do you think?