|
|
|
|
|
by valenterry
2031 days ago
|
|
Thank you for your link. I think the link captures it quite well. It says: > These <SubApp>s will be completely independent. They won't share data or actions, and won't see or communicate with each other. and > This pattern is not recommended for parts of the same app that share data. This is precisely where it gets interesting. Composition is important to combine things without these things knowing that they will be combined in advance and having to change them. So imagine there exists a redux application that shows a dashboard which lists sales within a timeframe. Now I build a new redux application that wants to use two of the existing redux applications next to each other, using one to show sales for last year and one to show sales for this year, using the same timeframe (months/days) but for different years. This is a very very simple case of composition, but it becomes tricky fast. Question: how do can I align the timeframes within the two sub-applications? I want to make it so that if the user changes the timeframe within one of the subapplications, it should translate to the other one and vice versa. Can I do this _without modifying the code of the sub-applications_? |
|