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

Support multiple receiver decorators on one static method #424

Open
ahnpnl opened this issue Dec 2, 2019 · 0 comments
Open

Support multiple receiver decorators on one static method #424

ahnpnl opened this issue Dec 2, 2019 · 0 comments

Comments

@ahnpnl
Copy link

ahnpnl commented Dec 2, 2019

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:

Current behavior

Current multiple @Receiver can't be used on one static method. This is not the case with @Action where multiple @Action can be used on one non-static method. There is an error throwing out in the console.
image

Expected behavior

@Receiver should have similar usage as @Action

Minimal reproduction of the problem with instructions

  • Clone this repo
  • Install dependencies with yarn.
  • Run ng serve.
  • Observe the error in the console

What is the motivation / use case for changing the behavior?

It will be for users to switch from @Action to @Receiver or vice versa without changing much of their codebase. In some situations users might want to listen to 2 different emitters but those emitters can have the same logic of updating state.

Environment


Libs:
- @angular/core version: 8.2.14
- @ngxs/store version: 3.5.1


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 10.17.0  
- Platform:  Windows 10 64bit

Others:
N.A.
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

No branches or pull requests

1 participant