Skip to content

Commit e8860f1

Browse files
committed
refactor(pagination): use Array.from instead of for loop
1 parent bd238c4 commit e8860f1

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

libs/flowbite-angular/pagination/pagination.component.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -434,17 +434,7 @@ export class PaginationComponent extends BaseComponent<PaginationClass> {
434434
* Array of the visible page tabs
435435
*/
436436
public readonly visiblePages = computed(() => {
437-
const pages: number[] = [];
438-
439-
for (
440-
let i = this.firstPageToShow();
441-
i < this.firstPageToShow() + this.visiblePagesCount();
442-
i++
443-
) {
444-
pages.push(i);
445-
}
446-
447-
return pages;
437+
return Array.from({ length: this.visiblePagesCount() }, (_, i) => this.firstPageToShow() + i);
448438
});
449439

450440
/**

0 commit comments

Comments
 (0)