zooniverse / wildcam-gorongosa-education

This is WildCam Labs, the education/exploration-oriented extension of the WildCam Gorongosa project.
https://lab.wildcamgorongosa.org/
Apache License 2.0
0 stars 1 forks source link

Refactor MapExplorer to be Redux-friendly #195

Closed shaunanoordin closed 8 years ago

shaunanoordin commented 8 years ago

Closes #104

The Map Explorer was originally built on (a very convoluted implementation of) the basic React patterns. As the project has progressed however, we've embraced the new Redux-React patterns which makes storing data (and communicating data between components) much more easier.

This refactor attempts to:

I'm still in the process of making the code lighter & easier, so shout if you have any suggestions.

simoneduca commented 8 years ago

@shaunanoordin LGTM, but I've got a suggestion. In ES6, var is the least informative way of declaring a variable, and let or const should be preferred when possible. Here: https://github.com/zooniverse/wildcam-gorongosa-education/blob/mapexplorer-redux-refactor/src/containers/MapExplorer.jsx#L141, as far I can see, both legend and div are not reassigned, so I think they should be const instead of var.

shaunanoordin commented 8 years ago

Thanks for the helpful feedback, @simoneduca ! I've gone through the Map Explorer code and improved the use of const and let across a few components. This PR is now ready for review!

simoneduca commented 8 years ago

👍