Quantcast
Channel: Seperation of concerns architecture React/Redux - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Seperation of concerns architecture React/Redux

$
0
0

~Disclaimer: this is an architecture question and contains traces of pseudocode.~

Assuming the following components:

<MapScreen><Map filters={filtersObject}/><MapFilters        filtersChanged={callback} //where callback returns a filters object    /> </MapScreen>

And a filters object looking ~like

filters = [{filterName: StringfilterColor: String}, ...]

There's a lot of ways to implement this but im more interested in the thinking behind which implementation to choose

The questions

A) Given that <Map Screen/> doesnt need to be aware of the filters object in itself, is it desireable to pass the filters object from the callback somehow (e.g redux) directly to the <Map/> object?

B) Yes <Map Screen/> could hold the filter state but it doesnt do anything with it other than grabbing it and propagating it back down so it just feels like i'd be designing my seperation of concerns based on convenience..

C) Many people are in favor of the B) way. If so, then there's the question of, should then <Map Filters/> only emit the filtersObject and receive it back in as a property instead of also storing it to it's own state thus avoiding having two states for the same thing?


I know the question here is very much up to personal taste but i'd love to hear your thoughts on this.

Many thanks.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images