hiposfer / hive

Your go-to routing app for public transport
GNU Lesser General Public License v3.0
10 stars 0 forks source link

consider passing the Datascript conn as arguments to all components #103

Closed carocad closed 6 years ago

carocad commented 6 years ago

Currently we fix the Datascript conn to a defonce var at initialization. This allows us to keep the state even after a figwheel reload.

However, this also created a proliferation of stateful components. Pretty much every component has a (work/pull! ...) or (work/q! ...) which by themselves are not wrong, but when combined with global state it can create a mess; specially for testing since you would need to re-create the global context to test the component.

One option would simply be to pass the Datascript conn as a Reagent ratom around. Although the components would still be stateful, they would then become much more easy to test as the state is local and can be re-created very easily.

carocad commented 6 years ago

reagent docs: