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

MatPaginator example emits changes on initialization #2921

Closed
dev054 opened this issue Feb 10, 2021 · 5 comments · Fixed by #3164
Closed

MatPaginator example emits changes on initialization #2921

dev054 opened this issue Feb 10, 2021 · 5 comments · Fixed by #3164

Comments

@dev054
Copy link

dev054 commented Feb 10, 2021

There's a documentation on https://ngrx.io/guide/component-store/usage#example-2-service-extending-componentstore showing on how to implement MatPaginator using ComponentStore (also thanks for it, a really nice example), however this excerpt seem to be have a bug that is the (page) is being emitted even if you don't change the page, on the initialization, while the MatPaginator version only emits (page) on truly changes. Could the code on documentation be adjusted accordingly?

I'm trying to follow that steps to implement a similar component and it would be really helpful if so and also it will help us to understand how the { debounce: true } works.

ComponentStore version: https://stackblitz.com/angular/vvxgxvlqvgd
Original version: https://stackblitz.com/edit/angular-yxh4es

Other information:

I would be willing to submit a PR for the docs ❤️

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

@timdeschryver
Copy link
Member

The example isn't intended to replace the MatPaginator, it's just used as an example.

@dev054
Copy link
Author

dev054 commented Feb 22, 2021

Hey @timdeschryver, yes I know that's just an example, but as it tends to mimic the behavior of MatPaginator I thought of open an issue here. In any case I've posted the question in SO and started a bounty. Could you help me there? Thanks.

@alex-okrushko alex-okrushko reopened this Feb 22, 2021
@alex-okrushko
Copy link
Member

Good point @dev054
Let's have it open if it's different from how material paginator behaves on initial loaded.

@timdeschryver
Copy link
Member

This is up for grabs if someone wants to create a Pull Request for it.

@boradakash
Copy link
Contributor

Hey @timdeschryver, Can I grab this up?

I am thinking of using rxjs skip operator to prevent emitting the latest value upon initial subscription, Do you think that's the correct solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants