SL-edi / covid-visualisation

0 stars 0 forks source link

Refactor data service for use with command pattern #20

Closed AdrianBorg closed 4 years ago

AdrianBorg commented 4 years ago

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 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

AdrianBorg commented 4 years ago

Closing because I've seen #13, which is simpler and does the job