diff --git a/frontend/src/app/selectors/front-page.selectors.ts b/frontend/src/app/selectors/front-page.selectors.ts new file mode 100644 index 0000000..b617c68 --- /dev/null +++ b/frontend/src/app/selectors/front-page.selectors.ts @@ -0,0 +1,20 @@ +import { createSelector } from '@ngrx/store'; +import { State as AppState } from '../reducers/index'; +import { State as FileState } from '../reducers/front-page.reducers'; + +export const selectFeature = (state: AppState) => state.fileState; + +export const selectFile = createSelector( + selectFeature, + (state: FileState) => state.file +); + +export const selectFileName = createSelector( + selectFeature, + (state: FileState) => state.fileName +); + +export const selectFetchStatus = createSelector( + selectFeature, + (state: FileState) => state.isFileFetched +);