nat236919 / covid19-api

API for exploring COVID-19 cases around the globe
https://nuttaphat.com/covid19-api/
MIT License
119 stars 63 forks source link

Observer Design Pattern #288

Closed Kanisha14 closed 3 years ago

Kanisha14 commented 3 years ago

The method get_US_time_series() of the class CovidAPIv2Integrator calls the class DataTimeSeries of the file get_data.py to fetch the time series. but to get the time series of the country Us, it specifies the method that bool for the US is true. Hence I implemented the observer pattern over here in a way that every time methods in class DataTimeSeries changes the state of US to true, it will notify our method get_US_time_series() of the class CovidAPIv2Integrator. once the method gets this update, it will proceed with retrieve data for the country US.

Proposed Changes

Checklist