lbry-desktop/ui/js/selectors/user.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

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
)
export const selectUser = createSelector(
2017-06-01 18:20:12 +02:00
_selectState,
(state) => state.user
)
2017-06-03 01:09:52 +02:00
export const selectUserIsRewardEligible = createSelector(
_selectState,
(state) => state.user.can_claim_rewards
)
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
)