Skip to content
Snippets Groups Projects
Commit 48423105 authored by OZGCloud's avatar OZGCloud
Browse files

remove unused imports; reorder methods

parent d6187e52
Branches
No related tags found
No related merge requests found
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; import { Component, EventEmitter, HostListener, Input, Output } from '@angular/core';
import { Component, EventEmitter, HostListener, Input, Output, ViewChild } from '@angular/core';
import { StateResource } from '@goofy-client/tech-shared'; import { StateResource } from '@goofy-client/tech-shared';
import { VorgangListResource, VorgangResource } from '@goofy-client/vorgang-shared'; import { VorgangListResource, VorgangResource } from '@goofy-client/vorgang-shared';
...@@ -17,12 +16,6 @@ export class VorgangListComponent { ...@@ -17,12 +16,6 @@ export class VorgangListComponent {
@Output() private nextPage: EventEmitter<void> = new EventEmitter<void>(); @Output() private nextPage: EventEmitter<void> = new EventEmitter<void>();
nextBatch(): void {
if (this.shouldLoadNextPage()) {
this.nextPage.emit();
}
}
@HostListener('window:scroll', ['$event']) @HostListener('window:scroll', ['$event'])
onWindowScroll(event) { onWindowScroll(event) {
try { try {
...@@ -36,6 +29,12 @@ export class VorgangListComponent { ...@@ -36,6 +29,12 @@ export class VorgangListComponent {
} catch (error) { } } catch (error) { }
} }
private nextBatch(): void {
if (this.shouldLoadNextPage()) {
this.nextPage.emit();
}
}
private shouldLoadNextPage(): boolean { private shouldLoadNextPage(): boolean {
return !this.vorgangListPageResource.loading && this.hasNextPage; return !this.vorgangListPageResource.loading && this.hasNextPage;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment