ParkingReformNetwork / parking-lot-map

Interactive map showing how much of downtowns are dominated by parking
https://parkingreform.org/parking-lot-map/
MIT License
1 stars 5 forks source link

Use reactive pattern for about and scorecard #254

Closed Eric-Arellano closed 3 months ago

Eric-Arellano commented 3 months ago

This PR splits out state management from how to display the UI/DOM. Now, for the scorecard accordion and about popup, we have two distinct functions:

Those two functions no longer have tight coupling, which makes them much easier to understand.

Specifically, we use the "Observable" design pattern (aka pub-sub). I also considered switching to Svelte, which has reactivity built-in, but I wanted to start with this simpler approach.

A follow up will use this pattern for the rest of the app.