Modifying how the command pattern is used. This way, a Command just stores a kind of template of what should be called but not the api to call. Then the api is specified when calling call(<api>).
The way we have it set up, the GetLatestDataCommand is used for 2 commands (global and country specific data fetches). To add others we would need to create a new Command class, then just pass them into the getResultFromOneApiFor method
Small edit to address this comment in another PR.
Modifying how the command pattern is used. This way, a
Command
just stores a kind of template of what should be called but not the api to call. Then the api is specified when callingcall(<api>)
.The way we have it set up, the
GetLatestDataCommand
is used for 2 commands (global and country specific data fetches). To add others we would need to create a new Command class, then just pass them into thegetResultFromOneApiFor
method