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
I know this is something that was not introduced in this PR, and we don't need to modify it now, but I in future when we have time, I wouldn't pass the echo.Context to the methods defined in the API struct. That's because, by doing so, we are coupling the API with the HTTP library that we are using to expose it even if we don't need to. In this function, we don't use the context at all, in other cases where we are using the context to retrieve some parameters, for instance the teamID, we could just directly pass that parameter to the function. By not coupling the API with the HTTP framework we make it easy to test the component and reason about it.
I know this is something that was not introduced in this PR, and we don't need to modify it now, but I in future when we have time, I wouldn't pass the
echo.Context
to the methods defined in theAPI
struct. That's because, by doing so, we are coupling the API with the HTTP library that we are using to expose it even if we don't need to. In this function, we don't use thecontext
at all, in other cases where we are using thecontext
to retrieve some parameters, for instance theteamID
, we could just directly pass that parameter to the function. By not coupling the API with the HTTP framework we make it easy to test the component and reason about it.Originally posted by @manelmontilla in #12 (comment)
The text was updated successfully, but these errors were encountered: