DigitalCommons / land-explorer-front-end

React app for the Land Explorer front end
http://landexplorer.cc
GNU Affero General Public License v3.0
1 stars 0 forks source link

LX-287 Remove arrays in Properties redux state to improve performance #297

Closed rogup closed 9 months ago

rogup commented 9 months ago

What? Why?

Closes #287

The 'properties' and 'selectedProperties' in RelatedPropertiesReducer are stored in arrays. We regularly filter and search for polygon objects within these arrays by poly_id. This fix improves the efficiency of these operations by converting the arrays to objects, with poly_id as key.

We do the same for 'highlightedProperties' in LandOwnershipReducer too.

What should we test?

There isn't a specific thing to test, since this is a general change to how data is stored in Redux and nothing should change for the user. Maybe just do a quick test by playing around with Backsearch and selecting/deselecting related properties. Also play around with some standard (non-backsearch) land ownership polygons too.

Release notes

Deployment notes

Documentation updates

lin-d-hop commented 9 months ago

Let's also test if this fixes #264

rogup commented 9 months ago

@ms0ur1s Passing for you to review :)

ms0ur1s commented 9 months ago

Sorry @rogup, missed this one. Looking through the changes is great learning for me, though. 👍