From c073f174c30362f8ee56fef2a1fa1bdb782611c0 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 29 Mar 2026 15:46:33 +0200 Subject: [PATCH] refactor(effects): replace combineLatestWith with withLatestFrom for improved readability Entire-Checkpoint: 84693b066142 --- libs/m3u-state/src/lib/effects.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/m3u-state/src/lib/effects.ts b/libs/m3u-state/src/lib/effects.ts index c9895974b..f31af09f1 100644 --- a/libs/m3u-state/src/lib/effects.ts +++ b/libs/m3u-state/src/lib/effects.ts @@ -1,13 +1,12 @@ import { inject, Injectable } from '@angular/core'; import { MatSnackBar } from '@angular/material/snack-bar'; import { Router } from '@angular/router'; +import { EpgService } from '@iptvnator/epg/data-access'; import { Actions, createEffect, ofType } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { StorageMap } from '@ngx-pwa/local-storage'; import { TranslateService } from '@ngx-translate/core'; -import { EpgService } from '@iptvnator/epg/data-access'; import { - combineLatestWith, EMPTY, filter, firstValueFrom, @@ -53,7 +52,7 @@ export class PlaylistEffects { () => { return this.actions$.pipe( ofType(FavoritesActions.updateFavorites), - combineLatestWith( + withLatestFrom( this.store.select(selectFavorites), this.store.select(selectActivePlaylistId) ), @@ -77,7 +76,7 @@ export class PlaylistEffects { () => { return this.actions$.pipe( ofType(FavoritesActions.setFavorites), - combineLatestWith(this.store.select(selectActivePlaylistId)), + withLatestFrom(this.store.select(selectActivePlaylistId)), filter(([, playlistId]) => !!playlistId), switchMap(([action, playlistId]) => this.playlistsService.setFavorites( @@ -96,7 +95,7 @@ export class PlaylistEffects { () => { return this.actions$.pipe( ofType(EpgActions.setActiveEpgProgram), - combineLatestWith(this.store.select(selectActive)), + withLatestFrom(this.store.select(selectActive)), map(([, activeChannel]) => { firstValueFrom(this.storage.get(STORE_KEY.Settings)).then( (settings: any) => {