michaelbromley / michaelbromley/angularUtils
dirPagination: on-page-change called 6 times each time I change page (version 0.9.4)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 842
- PR merge metrics
- No merged PRs in 30d
Description
I don't think it used to happen, but now I see that every time I change page the on-page-change event is triggered anything from 2 to 6 times resulting in slow list updates as each time it is called I refresh the page from the server (I am using server paging)
When debugging the code
scope.$watch(function() {
if (paginationService.isRegistered(paginationId)) {
return paginationService.getCurrentPage(paginationId);
}
}, function(currentPage, previousPage) {
if (currentPage != previousPage) {
goToPage(currentPage);
}
});
triggers the goToPage function multiple times when I change from one page to another
all the variables paginationId, currentPage and previousPage as as expected, it just calls the goToPage multiple times
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the repeated on-page-change calls in dirPagination on version 0.9.4, then inspect the shown scope.$watch, goToPage, and paginationService interactions. Confirm why one page change invokes goToPage multiple times and verify that server-paging consumers receive one event per change without regressing pagination behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angularjs, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100