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

metaReducers don't work in forFeature module when using createFeature #3216

Closed
evanfuture opened this issue Nov 1, 2021 · 2 comments · Fixed by #3218
Closed

metaReducers don't work in forFeature module when using createFeature #3216

evanfuture opened this issue Nov 1, 2021 · 2 comments · Fixed by #3218

Comments

@evanfuture
Copy link

evanfuture commented Nov 1, 2021

Minimal reproduction of the bug/regression with instructions:

https://stackblitz.com/edit/ngrx-seed-rh3wya?devtoolsheight=33&file=src/app/app.module.ts

Expected behavior:

When using createFeature, metaReducers stop working.

// THIS IS WHAT I EXPECT TO WORK
StoreModule.forFeature(counterFeature, {
    metaReducers: counterMetaReducers,
}),

 // THIS IS WHAT ACTUALLY WORKS
StoreModule.forFeature(counterFeature.name, counterFeature.reducer, {
    metaReducers: counterMetaReducers,
}),

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

Angular 12.x
NgRx 12.4.x

Other information:

I would be willing to submit a PR to fix this issue

[ ] Yes (Assistance is provided if you need help submitting a pull request)
[ x ] No
(I might, but I can't promise anything)

@timdeschryver
Copy link
Member

I think this is how we intended it to work, but I could be wrong though.
If that's the case, then we should fix the argument types of forFeature().

@brandonroberts
Copy link
Member

Yea, that's the case. If you need to add additional config, use the expanded form

brandonroberts pushed a commit that referenced this issue Nov 3, 2021
…3218)

Closes #3216

BREAKING CHANGES:

The `StoreConfig` argument is removed from the `StoreModule.forFeature` signature with `FeatureSlice`.

BEFORE:

The `StoreModule.forFeature` signature with `FeatureSlice` has `StoreConfig` as the second input argument, but the configuration isn't registered if passed.

AFTER:

The `StoreModule.forFeature` signature with `FeatureSlice` no longer has `StoreConfig` as the second input argument.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants