Download wp-calypso/client/state/current-user/email-verification/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 930 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/current-user/email-verification/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/current-user/email-verification/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/current-user/email-verification/reducer.js
930 Bytes
| import { | |
| EMAIL_VERIFY_REQUEST, | |
| EMAIL_VERIFY_REQUEST_SUCCESS, | |
| EMAIL_VERIFY_REQUEST_FAILURE, | |
| EMAIL_VERIFY_STATE_RESET, | |
| } from 'calypso/state/action-types'; | |
| import { combineReducers } from 'calypso/state/utils'; | |
| export const status = ( state = null, action ) => { | |
| switch ( action.type ) { | |
| case EMAIL_VERIFY_REQUEST: | |
| return 'requesting'; | |
| case EMAIL_VERIFY_REQUEST_SUCCESS: | |
| return 'sent'; | |
| case EMAIL_VERIFY_REQUEST_FAILURE: | |
| return 'error'; | |
| case EMAIL_VERIFY_STATE_RESET: | |
| return null; | |
| } | |
| return state; | |
| }; | |
| export const errorMessage = ( state = '', action ) => { | |
| switch ( action.type ) { | |
| case EMAIL_VERIFY_REQUEST: | |
| return ''; | |
| case EMAIL_VERIFY_REQUEST_SUCCESS: | |
| return ''; | |
| case EMAIL_VERIFY_REQUEST_FAILURE: { | |
| const { message } = action; | |
| return message; | |
| } | |
| case EMAIL_VERIFY_STATE_RESET: | |
| return ''; | |
| } | |
| return state; | |
| }; | |
| export default combineReducers( { | |
| status, | |
| errorMessage, | |
| } ); | |