My flux app displays a list locations. When user clicks on a location, it becomes 'active'. There can be only one active location at a time.
Should the state of location be a property of the location itself (e.g. location.active
) or should it be part of the global state, e.g. activeLocationId
?
I have written several variations of the app. It became obvious that active
is not a property of the item itself (location
in this case), but is the property of the UI (activeLocationId
).
Some benefits: