Download spectrum/src/reducers/modals.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 402 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/reducers/modals.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/src/reducers/modals.js
-
curl -L -o modals.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/reducers/modals.js
402 Bytes
| const initialState = { | |
| modalType: null, | |
| modalProps: {}, | |
| isOpen: false, | |
| }; | |
| export default function modal(state = initialState, action) { | |
| switch (action.type) { | |
| case 'SHOW_MODAL': | |
| return { | |
| modalType: action.modalType, | |
| modalProps: action.modalProps, | |
| isOpen: true, | |
| }; | |
| case 'HIDE_MODAL': | |
| return initialState; | |
| default: | |
| return state; | |
| } | |
| } | |