Created
October 9, 2021 04:26
-
-
Save xiongemi/f1e1d3d09eee20a9228c560cd4161a01 to your computer and use it in GitHub Desktop.
daily-horoscope-app horoscope.slice.ts horoscopeSelectors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getHoroscopeState = (rootState: RootState): HoroscopeState => | |
rootState[HOROSCOPE_FEATURE_KEY]; | |
const getUserZodiacItem = ( | |
rootState: RootState | |
): AdhZodiacSignItem | undefined => getHoroscopeState(rootState).zodiacSignItem; | |
const getUserZodiac = ( | |
rootState: RootState | |
): AdhZodiacSign | undefined => getUserZodiacItem(rootState)?.zodiacSign; | |
const getUserHoroscope = (rootState: RootState): AdhHoroscope | undefined => | |
getHoroscopeState(rootState).horoscope; | |
const getHoroscopeLoadingStatus = (rootState: RootState): LoadingStatus => | |
getHoroscopeState(rootState).loadingStatus; | |
export const horoscopeSelectors = { getUserZodiacItem, getUserZodiac, getUserHoroscope, getHoroscopeLoadingStatus }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment