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