Total Complexity | 2 |
Complexity/F | 0 |
Lines of Code | 18 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { RootState } from "../store"; |
||
2 | import { JobPosterStatus } from "../../models/types"; |
||
3 | import { JobStatusState } from "./jobStatusReducer"; |
||
4 | |||
5 | export const getJobStatusState = (state: RootState): JobStatusState => |
||
6 | state.jobStatuses; |
||
7 | |||
8 | export const getJobStatuses = (state: RootState): JobPosterStatus[] => |
||
9 | Object.values(getJobStatusState(state).byId); |
||
10 | |||
11 | export const getJobStatusById = ( |
||
12 | state: RootState, |
||
13 | { statusId }: { statusId: number }, |
||
14 | ): JobPosterStatus | null => getJobStatusState(state).byId[statusId] ?? null; |
||
15 | |||
16 | export const jobStatusesLoading = (state: RootState): boolean => |
||
17 | getJobStatusState(state).loading; |
||
18 |