2017-06-01 18:20:12 +02:00
|
|
|
import { createSelector } from 'reselect'
|
|
|
|
|
|
|
|
export const _selectState = state => state.user || {}
|
|
|
|
|
|
|
|
export const selectAuthenticationIsPending = createSelector(
|
|
|
|
_selectState,
|
|
|
|
(state) => state.authenticationIsPending
|
|
|
|
)
|
|
|
|
|
2017-06-02 02:51:52 +02:00
|
|
|
export const selectUser = createSelector(
|
2017-06-01 18:20:12 +02:00
|
|
|
_selectState,
|
2017-06-02 02:51:52 +02:00
|
|
|
(state) => state.user
|
|
|
|
)
|
|
|
|
|
2017-06-03 01:09:52 +02:00
|
|
|
export const selectUserIsRewardEligible = createSelector(
|
|
|
|
_selectState,
|
|
|
|
(state) => state.user.can_claim_rewards
|
|
|
|
)
|
|
|
|
|
2017-06-02 02:51:52 +02:00
|
|
|
export const selectEmailNewIsPending = createSelector(
|
|
|
|
_selectState,
|
|
|
|
(state) => state.emailNewIsPending
|
|
|
|
)
|
|
|
|
|
|
|
|
export const selectEmailNewErrorMessage = createSelector(
|
|
|
|
_selectState,
|
|
|
|
(state) => state.emailNewErrorMessage
|
|
|
|
)
|
|
|
|
|
|
|
|
export const selectEmailNewDeclined = createSelector(
|
|
|
|
_selectState,
|
|
|
|
(state) => state.emailNewDeclined
|
2017-06-03 01:09:52 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
export const selectEmailNewExistingEmail = createSelector(
|
|
|
|
_selectState,
|
|
|
|
(state) => state.emailNewExistingEmail
|
|
|
|
)
|
|
|
|
|
|
|
|
export const selectEmailVerifyIsPending = createSelector(
|
|
|
|
_selectState,
|
|
|
|
(state) => state.emailVerifyIsPending
|
|
|
|
)
|
|
|
|
|
|
|
|
export const selectEmailVerifyErrorMessage = createSelector(
|
|
|
|
_selectState,
|
|
|
|
(state) => state.emailVerifyErrorMessage
|
|
|
|
)
|