import { createSelector } from '@reduxjs/toolkit' import { initialProfileState } from '.' import { State } from '../types' // First select the relevant part from the state const selectDomain = (state: State) => state.profile || initialProfileState export const selectProfileLoading = createSelector([selectDomain], (profileState) => profileState.loading) export const selectProfileData = createSelector([selectDomain], (profileState) => profileState.profileData || {})