Download wp-calypso/client/state/command-palette/reducers.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 530 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/command-palette/reducers.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/command-palette/reducers.ts
-
curl -L -o reducers.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/command-palette/reducers.ts
530 Bytes
| import { COMMAND_PALETTE_CLOSE, COMMAND_PALETTE_OPEN } from 'calypso/state/action-types'; | |
| import type { AnyAction } from 'redux'; | |
| const initialState = { | |
| isCommandPaletteOpen: false, | |
| }; | |
| const commandPaletteReducer = ( state = initialState, action: AnyAction ) => { | |
| switch ( action.type ) { | |
| case COMMAND_PALETTE_OPEN: | |
| return { ...state, isCommandPaletteOpen: true }; | |
| case COMMAND_PALETTE_CLOSE: | |
| return { ...state, isCommandPaletteOpen: false }; | |
| default: | |
| return state; | |
| } | |
| }; | |
| export default commandPaletteReducer; | |