restructure code to reduce dependencies #973
Labels
challenging
indicates that fixing this issue is expected to be more challenging than average
enhancement
New feature or request
See google/built_value.dart#1304
I'm not sure how feasible this is given the current architecture. As David Morgan said, we use this global variable app all over the place, so in some sense anywhere it's used essentially the whole project is being imported. But maybe it's possible to use packages to officially declare that the view depends on the model but not the other way around, for instance. Similarly the reducers depend on the model but not the other way around, and there's no dependence between the view and reducers.
Most of the usages of the global
app
variable are:app.dispatch
to dispatch an action. This is done throughapp
because it stores the Redux stores.AppState
. This is typically done in code in view files, but not in React render methods, in keeping with the principle I explained here: https://stackoverflow.com/questions/62942644/how-to-make-a-react-component-intelligently-dispatch-a-redux-action-on-user-inte.Unfortunately, these both in some sense seem to preclude splitting up the
app
variable into other smaller global variables. The first is needed to access the Redux stores, one of which stores the entire currentAppState
, and the second also requires accessing the currentAppState
, also through the main store.The text was updated successfully, but these errors were encountered: