import { Injectable } from '@angular/core' ; import { ActionsSubject , ReducerManager , StateObservable , Store } from '@ngrx/store' ; import { flow } from 'lodash/fp' ; import { BehaviorSubject } from 'rxjs' ; @ Injectable ( ) export class MockStore < T extends Object > extends Store < T > { private readonly subject = flow ( ( ) => { } , ( cur ) => new BehaviorSubject < T > ( cur ) ) ( ) ; constructor ( readonly state$ , actionsObserver , reducerManager ) { super ( state$ , actionsObserver , reducerManager ) ; this . source = this . subject . asObservable ( ) ; } setState ( nextState ) { this . subject . next ( nextState ) ; } }