You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m working on a project with a shared codebase that renders two different apps: Search App and Manage App. Both apps have distinct behaviors, but share some common logic and infrastructure.
Key Details:
App Structure:
The two apps may need to run side by side, which requires them to have isolated state management and API configurations to prevent interference between the two.
Redux Store:
I’m considering two approaches:
One store with namespaced reducers for each app (e.g., searchApp and manageApp within the root state).
Two completely separate stores, where each app has its own store.
Given the potential for both apps to run concurrently and to avoid state contamination, I’m leaning towards using two separate stores.
Axios Instances:
Each app also requires a different Axios instance to handle API requests, as the apps will interact with different backend services. I’m thinking of conditionally configuring Axios based on the app in use.
Request for Guidance:
Is maintaining two separate stores the best approach in this scenario, especially considering the likelihood of the apps running side by side? Or would a single store with namespaced reducers suffice?
Are there any best practices or potential pitfalls to watch out for when using separate stores alongside different Axios configurations for each app?
If I opt for a single store, is there any guidance or recommended patterns for conditionally rendering reducers inside combineReducers based on the running app?
Thank you for any advice or insights you can provide! I want to ensure I’m following best practices, particularly as the apps evolve and potentially grow more complex.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Redux Team,
I’m working on a project with a shared codebase that renders two different apps: Search App and Manage App. Both apps have distinct behaviors, but share some common logic and infrastructure.
Key Details:
App Structure:
The two apps may need to run side by side, which requires them to have isolated state management and API configurations to prevent interference between the two.
Redux Store:
I’m considering two approaches:
One store with namespaced reducers for each app (e.g., searchApp and manageApp within the root state).
Two completely separate stores, where each app has its own store.
Given the potential for both apps to run concurrently and to avoid state contamination, I’m leaning towards using two separate stores.
Axios Instances:
Each app also requires a different Axios instance to handle API requests, as the apps will interact with different backend services. I’m thinking of conditionally configuring Axios based on the app in use.
Request for Guidance:
Is maintaining two separate stores the best approach in this scenario, especially considering the likelihood of the apps running side by side? Or would a single store with namespaced reducers suffice?
Are there any best practices or potential pitfalls to watch out for when using separate stores alongside different Axios configurations for each app?
If I opt for a single store, is there any guidance or recommended patterns for conditionally rendering reducers inside combineReducers based on the running app?
Thank you for any advice or insights you can provide! I want to ensure I’m following best practices, particularly as the apps evolve and potentially grow more complex.
Best regards,
Guy
Beta Was this translation helpful? Give feedback.
All reactions