optimize read calls

This commit is contained in:
2026-03-09 16:32:13 +01:00
parent ed69d9e972
commit 3fb2e8b341
11 changed files with 64 additions and 43 deletions

View File

@@ -3,7 +3,7 @@ import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {SongService} from './song.service';
import {Song} from './song';
import {filter} from 'rxjs/operators';
import {take} from 'rxjs/operators';
@Injectable({
providedIn: 'root',
@@ -12,6 +12,6 @@ export class SongListResolver {
public constructor(private songService: SongService) {}
public resolve(): Observable<Song[]> {
return this.songService.list$().pipe(filter(_ => _.length > 0));
return this.songService.list$().pipe(take(1));
}
}