Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front: Implement caching mechanism for region geometries in RegionMap…
… component. This commit introduces a caching strategy in the MapComponent of the RegionMap module. The primary change involves the addition of a useRef hook to maintain a cache of the last 10 fetched region geometries. This cache is an array stored in regionGeometryCache. The fetchSelectedRegionGeometry function is updated to first check if the selected region's geometry is already available in the cache. If not found, it fetches the geometry from the API, adds it to the cache, and ensures that the cache size does not exceed 10 items by removing the oldest entry when necessary. Issue: #103 Signed-off-by: Nikolay Martyanov <[email protected]>
- Loading branch information