All files / app/codeCharta/state/effects/unfocusNodes unfocusNodes.effect.ts

100% Statements 12/12
100% Branches 0/0
100% Functions 3/3
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151x 1x 1x 1x 1x 1x       1x 1x   2x    
import { Injectable } from "@angular/core"
import { map } from "rxjs"
import { createEffect } from "@ngrx/effects"
import { visibleFileStatesSelector } from "../../selectors/visibleFileStates/visibleFileStates.selector"
import { unfocusAllNodes } from "../../store/dynamicSettings/focusedNodePath/focusedNodePath.actions"
import { Store } from "@ngrx/store"
import { CcState } from "../../../codeCharta.model"
 
@Injectable()
export class UnfocusNodesEffect {
    constructor(private store: Store<CcState>) {}
 
    unfocusNodes$ = createEffect(() => this.store.select(visibleFileStatesSelector).pipe(map(() => unfocusAllNodes())))
}