angularngrxngrx-storeangular-ngrx-data

Is it possible to get a regular value from state and not as Observable angular Ngrx?


I'm wondering if I can get a regular value type from NGRX state and not an Observable?


Solution

  • Since the State class extends BehaviorSubject:

    export class State<T> extends BehaviorSubject<any> implements OnDestroy { ... }
    

    I think you can get the current state by injecting State and calling state.getValue().