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

feat(Store): Added simplified API for adding meta-reducers #87

Merged
merged 1 commit into from
Jul 18, 2017

Conversation

brandonroberts
Copy link
Member

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 88.365% when pulling c55eff8 on metareducer-api into b9776ea on master.

metaReducers?: ActionReducer<any, any>[]
): ActionReducerFactory<any, any> {
if (Array.isArray(metaReducers) && metaReducers.length > 0) {
return compose.apply(null, [...metaReducers, reducerFactory]);
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to apply:

return compose(...metaReducers, reducerFactory)

Copy link
Member Author

Choose a reason for hiding this comment

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

TypeScript doesn't agree with signature, which is why I used apply:

ERROR in ngrx/platform/modules/store/src/utils.ts (92,12): Supplied parameters do not match any signature of call target.

@bfricka
Copy link
Contributor

bfricka commented Jul 18, 2017

I like the idea here. When writing tests, it took me a minute to realize reducerFactory would likely be used for this purpose.

@MikeRyanDev MikeRyanDev merged commit d2295c7 into master Jul 18, 2017
@MikeRyanDev MikeRyanDev deleted the metareducer-api branch July 18, 2017 11:44
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.

4 participants