Open takuyaW opened 1 week ago
@takuyaW From my understanding the problem with several custom hooks is that i will create several states in different hooks that depend on each other. So I think leaving them at one place will make the logic easier and would prevent race conditions (for example all hooks will need to work with the same maps instance that i will need to pass around etc.)
Background
The current MapboxProvider component needs to be refactored by extracting logic into custom hooks to achieve better separation of concerns.
Implementation
1. Create
useMapSetup
HookThis hook will handle map initialization and configuration.
2. Create
useMarkers
HookThis hook will manage marker-related state and operations.
3. Create
useLocationFilters
HookThis hook will handle location filtering functionality.
Technical Considerations
useEffect
cleanup functions