mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 21:43:04 +00:00
metadata service
This commit is contained in:
23
src/app/shared/mocks/mock-store.ts
Normal file
23
src/app/shared/mocks/mock-store.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Action } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
|
||||
export class MockStore<T> extends BehaviorSubject<T> {
|
||||
|
||||
constructor(private _initialState: T) {
|
||||
super(_initialState);
|
||||
}
|
||||
|
||||
dispatch = (action: Action): void => {
|
||||
console.info();
|
||||
}
|
||||
|
||||
select = <R>(pathOrMapFn: any): Observable<T> => {
|
||||
return Observable.of(this.getValue());
|
||||
}
|
||||
|
||||
nextState(_newState: T) {
|
||||
this.next(_newState);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user