Skip to content
Snippets Groups Projects
Commit 07396efe authored by jojohoch's avatar jojohoch
Browse files

[player] Remove unused scroll subscription

Intersection detection is done by `Intersectionobserver`
parent 05a5c89f
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,6 @@ export class AppComponent implements OnInit {
private initSubscriptions(): void {
this.veronaSubscriptionService.vopStartCommand
.subscribe((message: VopStartCommand): void => this.onStart(message));
this.nativeEventService.scrollY
.subscribe((y: number): void => this.onScrollY(y));
this.nativeEventService.focus
.subscribe((focused: boolean): void => this.onFocus(focused));
}
......@@ -111,10 +109,6 @@ export class AppComponent implements OnInit {
}))
}));
// eslint-disable-next-line @typescript-eslint/no-unused-vars
private onScrollY = (y: number): void => {
};
private onFocus(focused: boolean): void {
// eslint-disable-next-line no-console
console.log('player: onFocus', focused);
......
......@@ -9,12 +9,9 @@ import { mergeMap } from 'rxjs/operators';
providedIn: 'root'
})
export class NativeEventService {
private _scrollY = new Subject<number>();
private _focus = new Subject<boolean>();
constructor(@Inject(DOCUMENT) private document: Document) {
fromEvent(window, 'scroll')
.subscribe(() => this._scrollY.next(window.scrollY));
from(['blur', 'focus'])
.pipe(
mergeMap(event => fromEvent(window, event))
......@@ -24,10 +21,6 @@ export class NativeEventService {
);
}
get scrollY(): Observable<number> {
return this._scrollY.asObservable();
}
get focus(): Observable<boolean> {
return this._focus.asObservable();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment