Download Easy-Consulting-react/src/context/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 414 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Easy-Consulting-react/src/context/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/Easy-Consulting-react/src/context/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Easy-Consulting-react/src/context/reducer.js
414 Bytes
| import { SET_ADMIN, SET_SELECTED_SERVICE, SET_USER } from "./actionTypes"; | |
| export const reducer = (state, action) => { | |
| switch (action.type) { | |
| case SET_USER: | |
| return { ...state, user: action.payload }; | |
| case SET_ADMIN: | |
| return { ...state, admin: action.payload }; | |
| case SET_SELECTED_SERVICE: | |
| return { ...state, selectedService: action.payload }; | |
| default: | |
| return state; | |
| } | |
| }; | |