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

RFC: Accept InjectionToken in EffectsModule.forFeature #2232

Closed
leon-marzahn opened this issue Nov 8, 2019 · 2 comments · Fixed by #2231
Closed

RFC: Accept InjectionToken in EffectsModule.forFeature #2232

leon-marzahn opened this issue Nov 8, 2019 · 2 comments · Fixed by #2231

Comments

@leon-marzahn
Copy link
Contributor

It is currently not possible to register effects (EffectsModule.forFeature) with an InjectionToken like it's possible in StoreModule.forFeature. Adding this feature could open some possiblities of reducing boilerplate in applications.
Pull Request #2231 (Help needed for how to document and test)

Describe any alternatives/workarounds you're currently using

An alternative is using InjectionTokens for everything but the effects, but that leads to some complications, an example from my current project:

EffectsModule.forFeature([
  FeatureStore.createEffects(
    ACTIONS_TOKEN,
    FeatureService,
  ),
])

Other information:

Hey there, this is my first attempt at contributing and this is my first feature request :D

If accepted, I would be willing to submit a PR for this feature

[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

@brandonroberts
Copy link
Member

What's your use case? Reducing boilerplate is not a use case 😉

@leon-marzahn
Copy link
Contributor Author

@brandonroberts My specific use case is to reduce boilerplate. I want to create a library that makes it possible to create actions, reducers, effects and selectors via a single class. And because this already works in StoreModule.forFeature, it would make sense to also have it in EffectsModule.forFeature

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