[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
A selector should be declared after it's dependencies in a query class.
Any developer-preferred selectors order.
Or an exception or, at least, a warning in the console that indicates that there is an issue with a hint on how to fix it.
https://stackblitz.com/edit/angular-qczwnr?file=src/app/store/counter.query.ts
Happy ngxs users
Libs:
- @angular/core version: 8.0.3
- @ngxs/store version: 3.4.3
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: XX
- Platform:
Others:
I'm confirming this is not an issue.

This is not related to the NGXS itself but rather to TypeScript decorators behavior, decorators are invoked from top to bottom, so basically you're trying to access non-decorated methods yet with @Selector.

And yes, it works if I change an order:

Is there a way for library to check if the accessed method is decorated or not?
Maybe mention this behavior in a documentation?
@t-denis I understand your agitation. I'm discussing that with my NGXS teammate. Sorry for the late answer, been busy.
@t-denis I will make a PR to mention this. WIll take your code as an example if you don't mind :wink:
@t-denis I have merged a PR that should fix this issue. Please could you test with the @ngxs/store@dev package and confirm if it is fixed for you or not.
@markwhitfeld
The issue is fixed, everything works as expected. Thanks!