Download wp-calypso/client/state/immediate-login/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 638 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/immediate-login/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/immediate-login/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/immediate-login/reducer.js
638 Bytes
| import { withStorageKey } from '@automattic/state-utils'; | |
| import { IMMEDIATE_LOGIN_SAVE_INFO } from 'calypso/state/action-types'; | |
| const initialState = { | |
| attempt: false, | |
| success: false, | |
| reason: null, | |
| email: null, | |
| locale: null, | |
| }; | |
| const reducer = ( state = initialState, action ) => { | |
| switch ( action.type ) { | |
| case IMMEDIATE_LOGIN_SAVE_INFO: { | |
| const { success, reason, email, locale } = action; | |
| return { | |
| attempt: true, | |
| success: !! success, | |
| reason: reason || null, | |
| email: email || null, | |
| locale: locale || null, | |
| }; | |
| } | |
| } | |
| return state; | |
| }; | |
| export default withStorageKey( 'immediateLogin', reducer ); | |