hiposfer / hive

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

consider refactoring "effectful" state functions into pure functions #63

Closed carocad closed 6 years ago

carocad commented 6 years ago

Currently the app state is manipulated directly through transact! which turns out to be globally assessable.

This creates a problem since you can call it anywhere without actually declaring before that you needed access to the state. A propagation is a globally modifiable state is definitely not desirable !

A better way would simply be to have a state and a watch component which handle the transactions and state listeners.

If a component wants to be able to modify the state they would need to declare that at system creation, thus reducing the ability of arbitrary code to modify the state silently.

carocad commented 6 years ago

this no longer applies since you cannot modify the state directly but through datascript transactions