0

I have requirement where i need to open a popup from main react application and this popup will have to have a seperate redux store from parent(its one more big application as good as parent application). Can we communicate between two?

Idea is to have this popup application as a node module and use in different pages as reusable component. So now i have coupe of questions

  1. can we have 2 redux stores created and make them communicate each other
  2. i saw something about maintaining sub apps, give here https://gist.github.com/gaearon/eeee2f619620ab7b55673a4ee2bf8400 . Can we maintain communication between the main app and sub app stores?
  3. How to maintain the router in a popup application, As the history back doesnt work in popup window. Any ideas here?

Would appreciate if you can share any live example.

Sumanth madey
  • 548
  • 2
  • 7
  • 16
  • Sounds like a bad idea, you can simply organize that one store to contain two big objects - one for the app and one for the sub, and then maintain the option to communicate whilst having a separate state object. – Barazu May 28 '18 at 18:58
  • Question is already answered here >> https://stackoverflow.com/a/54556221/8625811 – Rizwan Feb 06 '19 at 14:48

1 Answers1

2

The original Flux pattern describes having multiple “stores” in an app, each one holding a different area of domain data. This can introduce issues such as needing to have one store “waitFor” another store to update. This is not necessary in Redux because the separation between data domains is already achieved by splitting a single reducer into smaller reducers. Hope i could help read more in the link

Kunal Burangi
  • 360
  • 4
  • 12