Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seed reducers after adding them #80

Merged
merged 3 commits into from May 2, 2019
Merged

Seed reducers after adding them #80

merged 3 commits into from May 2, 2019

Conversation

abettadapur
Copy link
Collaborator

Issue: When reducers were added, we did not dispatch an action to seed them with initial state. This meant that the initial state was not available to any of the extensions of the module.

Fix:
Seed the reducers by firing an action after adding them

@abettadapur
Copy link
Collaborator Author

Will add tests for this scenario

@@ -26,6 +26,10 @@ export function getModuleManager<State>(
let _modules: IModule<any>[] = [];
const _moduleIds = new Set();

const _seedReducers = () => {
_dispatch({ type: "@@Internal/ModuleManager/SeedReducers" });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some comments on the scenario on why this is needed.

@abettadapur abettadapur merged commit 73363f2 into master May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants