add scroll service
This commit is contained in:
1 parent
3bb0935db9
commit
2a904b4878
2 files changed
+19
No files matched your search
@@ -18,6 +18,7 @@ import { SearchPopupComponent } from './components/search-popup/search-popup.com
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { SearchPopupEntryLineComponent } from './components/search-popup-entry-line/search-popup-entry-line.component';
|
||||
import { ScrollService } from './services/scroll.service';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@@ -44,6 +45,7 @@ import { SearchPopupEntryLineComponent } from './components/search-popup-entry-l
|
||||
EpisodeSeenService,
|
||||
SeasonService,
|
||||
|
||||
ScrollService,
|
||||
ToggleService,
|
||||
ThemeService,
|
||||
],
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ScrollService {
|
||||
private scrollEndSubject = new Subject<void>();
|
||||
|
||||
// Observable for subcomponents to subscribe
|
||||
scrollEnd$ = this.scrollEndSubject.asObservable();
|
||||
|
||||
// Emit scroll end event
|
||||
notifyScrollEnd(): void {
|
||||
this.scrollEndSubject.next();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user