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

Cannot use @ViewSelectSnapshot multiple times in one Component #102

Open
7 tasks
anschm opened this issue Feb 22, 2021 · 7 comments
Open
7 tasks

Cannot use @ViewSelectSnapshot multiple times in one Component #102

anschm opened this issue Feb 22, 2021 · 7 comments

Comments

@anschm
Copy link

anschm commented Feb 22, 2021

If I use @ViewSelectSnapshot in one Component multiple times like:

@component({
selector: 'app-progress',
template: <div> <div> <span>progress1</span> </div> <div> <span>progress2</span> </div> </div>,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ProgressComponent {
@ViewSelectSnapshot(ProgressState.getProgress1) progress1: number;

@ViewSelectSnapshot(ProgressState.getProgress2) progress2: number;
}

MarkForCheck is only executed if progress2 is changed in the state. If progress1 is changed no markforcheck is executed.

[ ] 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:

Libs:

  • @angular/core version: 11.2.0
  • @ngxs/store version: 3.7.1

Browser:

  • [ x] Chrome (desktop)
  • 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
@codemile
Copy link

codemile commented Apr 6, 2021

I'm having this problem as well.

@markwhitfeld
Copy link
Member

@arturovt what do you think about this?

@arturovt
Copy link
Member

arturovt commented Apr 6, 2021

I will have a look when I have some time.

@arturovt
Copy link
Member

I wasn't able to reproduce it. Please provide a minimal reproducible example.

@arturovt
Copy link
Member

I've published @ngxs-labs/[email protected] which is compatible with Angular 10.0.5+. I cannot say if it resolves this issue or not.

@codemile
Copy link

codemile commented Apr 20, 2021

@arturovt thank you. I'll give it a try.

@anschm
Copy link
Author

anschm commented Jun 27, 2021

Thanks. I check it in my project. It seams it is working. I am watching on it the next time and give feedback again later.

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

4 participants