refactor(ebook-reader): optimize destruction handling and improve reactive subscriptions (#478)

This commit is contained in:
brios
2026-04-22 17:27:38 -04:00
committed by Zach Yale
parent e26df36a33
commit 1f5f99d958
26 changed files with 1112 additions and 1068 deletions
@@ -1,4 +1,4 @@
import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
import {ChangeDetectionStrategy, Component, computed, input} from '@angular/core';
import {NgClass} from '@angular/common';
import {Book} from '../../../book/model/book.model';
import {ScrollerType} from '../../models/dashboard-config.model';
@@ -21,14 +21,12 @@ import {TranslocoDirective, TranslocoPipe} from '@jsverse/transloco';
})
export class DashboardScrollerComponent {
@Input() bookListType: ScrollerType | null = null;
@Input() title!: string;
@Input() books!: Book[] | null;
@Input() isMagicShelf: boolean = false;
@Input() useSquareCovers: boolean = false;
@Input() overlayPreferenceService!: BookCardOverlayPreferenceService;
readonly bookListType = input<ScrollerType | null>(null);
readonly title = input.required<string>();
readonly books = input<Book[] | null>(null);
readonly isMagicShelf = input<boolean>(false);
readonly useSquareCovers = input<boolean>(false);
readonly overlayPreferenceService = input.required<BookCardOverlayPreferenceService>();
get forceEbookMode(): boolean {
return this.bookListType === ScrollerType.LAST_READ;
}
readonly forceEbookMode = computed(() => this.bookListType() === ScrollerType.LAST_READ);
}