tyeung2017 / sunsetly

Searching sun rise and sun set time in UTC by location names and date
https://sunsetly.herokuapp.com/
0 stars 0 forks source link

Pull api data handling out of handler. #22

Open finnhodgkin opened 7 years ago

finnhodgkin commented 7 years ago

Handlers should be handling server things not manipulating api data. This functionality would be more at home in myRequest.js or preferably a totally new file:

https://github.com/tyeung2017/sunsetly/blob/master/src/handlers.js#L38-L55

It's all testable logic so should definitely be abstracted into separate pure functions.

finnhodgkin commented 7 years ago

I know it's difficult because there are nested requests but it's still very possible and necessary.