Download wp-calypso/client/state/ui/preview/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 581 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/ui/preview/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/ui/preview/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/ui/preview/reducer.js
581 Bytes
| import { PREVIEW_URL_CLEAR, PREVIEW_URL_SET } from 'calypso/state/action-types'; | |
| import { combineReducers } from 'calypso/state/utils'; | |
| export function currentPreviewSiteId( state = null, action ) { | |
| switch ( action.type ) { | |
| case PREVIEW_URL_SET: | |
| return action.siteId ?? null; | |
| } | |
| return state; | |
| } | |
| export function currentPreviewUrl( state = null, action ) { | |
| switch ( action.type ) { | |
| case PREVIEW_URL_SET: | |
| return action.url; | |
| case PREVIEW_URL_CLEAR: | |
| return null; | |
| } | |
| return state; | |
| } | |
| export default combineReducers( { | |
| currentPreviewSiteId, | |
| currentPreviewUrl, | |
| } ); | |