Skip to content

Commit

Permalink
chore(sso): remoe ramda for selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Han committed Sep 28, 2021
1 parent da159ea commit a852b7d
Showing 1 changed file with 63 additions and 50 deletions.
113 changes: 63 additions & 50 deletions packages/blockchain-wallet-v4-frontend/src/data/auth/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,66 @@ import { RootState } from 'data/rootReducer'

import { AuthStateType } from './types'

export const isAuthenticated: (state: RootState) => AuthStateType['isAuthenticated'] | undefined =
path(['auth', 'isAuthenticated'])
export const getRegistering: (state: RootState) => AuthStateType['registering'] = path([
'auth',
'registering'
])
export const getFirstLogin: (state: RootState) => AuthStateType['firstLogin'] | undefined = path([
'auth',
'firstLogin'
])
export const getRestoring: (state: RootState) => AuthStateType['restoring'] = path([
'auth',
'restoring'
])
export const getAuthType: (state: RootState) => AuthStateType['auth_type'] | undefined = path([
'auth',
'auth_type'
])
export const getDesignatedProduct: (
state: RootState
) => AuthStateType['designatedProduct'] | undefined = path(['auth', 'designatedProduct'])
export const getSecureChannelLogin: (state: RootState) => AuthStateType['secureChannelLogin'] =
path(['auth', 'secureChannelLogin'])
export const getLogin: (state: RootState) => AuthStateType['login'] = path(['auth', 'login'])
export const getMobileLoginStarted: (
state: RootState
) => AuthStateType['mobileLoginStarted'] | undefined = path(['auth', 'mobileLoginStarted'])
export const getRegisterEmail: (state: RootState) => AuthStateType['registerEmail'] = path([
'auth',
'registerEmail'
])
export const getMetadataRestore: (state: RootState) => AuthStateType['metadataRestore'] = path([
'auth',
'metadataRestore'
])
export const getKycResetStatus: (state: RootState) => AuthStateType['kycReset'] = path([
'auth',
'kycReset'
])
export const getAccountReset: (state: RootState) => AuthStateType['resetAccount'] | undefined =
path(['auth', 'resetAccount'])
export const getMagicLinkData = (state: RootState) => state.auth.magicLinkData
export const getUserGeoData: (state: RootState) => AuthStateType['userGeoData'] = path([
'auth',
'userGeoData'
])
export const getManifest: (state: RootState) => AuthStateType['manifestFile'] = path([
'auth',
'manifestFile'
])
export function isAuthenticated(state: RootState): AuthStateType['isAuthenticated'] {
return state.auth.isAuthenticated
}

export function getRegistering(state: RootState): AuthStateType['registering'] {
return state.auth.isAuthenticated
}

export function getFirstLogin(state: RootState): AuthStateType['firstLogin'] {
return state.auth.firstLogin
}

export function getRestoring(state: RootState): AuthStateType['restoring'] {
return state.auth.restoring
}

export function getAuthType(state: RootState): AuthStateType['auth_type'] {
return state.auth.auth_type
}

export function getDesignedProduct(state: RootState): AuthStateType['designatedProduct'] {
return state.auth.designedProduct
}

export function getSecuredChannelLogin(state: RootState): AuthStateType['secureChannelLogin'] {
return state.auth.secureChannelLogin
}

export function getLogin(state: RootState): AuthStateType['login'] {
return state.auth.login
}

export function getMobileLoginStarted(state: RootState): AuthStateType['mobileLoginStarted'] {
return state.auth.mobileLoginStarted
}

export function getRegisterEmail(state: RootState): AuthStateType['registerEmail'] {
return state.auth.registerEmail
}

export function getMetadataRestore(state: RootState): AuthStateType['metadataRestore'] {
return state.auth.metadataRestore
}

export function getKycResetStatus(state: RootState): AuthStateType['kycReset'] {
return state.auth.kycReset
}

export function getAccountReset(state: RootState): AuthStateType['resetAccount'] {
return state.auth.resetAccount
}

export function getMagicLinkData(state: RootState): AuthStateType['magicLinkData'] {
return state.auth.magicLinkData
}

export function getUserGeoData(state: RootState): AuthStateType['userGeoData'] {
return state.auth.userGeoData
}

export function getManifest(state: RootState): AuthStateType['manifestFile'] {
return state.auth.manifestFile
}

0 comments on commit a852b7d

Please sign in to comment.