Skip to content

Support multiple receiver decorators on one static method #424

@ahnpnl

Description

@ahnpnl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions