import get from "lodash/get"; import { RoleSchema, Submission } from "../../interfaces"; import { selectRoot } from "../root"; import { AUTH } from "./auth.constant"; import { AuthState } from "./auth.reducers"; export const selectAuth = (state: any) => selectRoot(AUTH, state); export const selectUser = (state: any): null | Submission => get(selectAuth(state), "user"); export const selectRoles = (state: any): Record => get(selectAuth(state), "roles"); export const selectIsAuthenticated = (state: any): boolean => get(selectAuth(state), "authenticated");