diff --git a/src/app/core/data/bitstream-format-data.service.ts b/src/app/core/data/bitstream-format-data.service.ts index b5c2b708dc..c30330a0a3 100644 --- a/src/app/core/data/bitstream-format-data.service.ts +++ b/src/app/core/data/bitstream-format-data.service.ts @@ -25,8 +25,12 @@ import { import { hasValue } from '../../shared/empty.util'; import { RequestEntry } from './request.reducer'; import { CoreState } from '../core.reducers'; +import { coreSelector } from '../core.selectors'; -const bitstreamFormatsStateSelector = (state: CoreState) => state.bitstreamFormats; +const bitstreamFormatsStateSelector = createSelector( + coreSelector, + (state: CoreState) => state.bitstreamFormats +); const selectedBitstreamFormatSelector = createSelector(bitstreamFormatsStateSelector, (bitstreamFormatRegistryState: BitstreamFormatRegistryState) => bitstreamFormatRegistryState.selectedBitstreamFormats); diff --git a/src/app/core/history/selectors.ts b/src/app/core/history/selectors.ts index a04d3839b1..5c77cd65f0 100644 --- a/src/app/core/history/selectors.ts +++ b/src/app/core/history/selectors.ts @@ -1,3 +1,8 @@ import { CoreState } from '../core.reducers'; +import { createSelector } from '@ngrx/store'; +import { coreSelector } from '../core.selectors'; -export const historySelector = (state: CoreState) => state.history; +export const historySelector = createSelector( + coreSelector, + (state: CoreState) => state.history +); diff --git a/src/app/core/services/route.service.spec.ts b/src/app/core/services/route.service.spec.ts index 525329d50f..07ff56d879 100644 --- a/src/app/core/services/route.service.spec.ts +++ b/src/app/core/services/route.service.spec.ts @@ -142,7 +142,11 @@ describe('RouteService', () => { describe('getHistory', () => { it('should dispatch AddUrlToHistoryAction on NavigationEnd event', () => { - serviceAsAny.store = observableOf({ history: ['url', 'newurl'] }); + serviceAsAny.store = observableOf({ + core: { + history: ['url', 'newurl'] + } + }); service.getHistory().subscribe((history) => { expect(history).toEqual(['url', 'newurl']);