Spaces:
Sleeping
Sleeping
Download frontend/src/store/index.js from danielle2035/Intel_classification: direct link, hf CLI and curl.
- Browser
- Download file 775 Bytes
-
https://huggingface.co/spaces/danielle2035/Intel_classification/resolve/main/frontend/src/store/index.js
- Command line
-
hf download hf://spaces/danielle2035/Intel_classification/frontend/src/store/index.js
-
curl -L -o index.js https://huggingface.co/spaces/danielle2035/Intel_classification/resolve/main/frontend/src/store/index.js
775 Bytes
| import {createSlice, configureStore} from '@reduxjs/toolkit'; | |
| const authSlice = createSlice({ | |
| name: "auth", | |
| initialState: { | |
| isLoggedIn: false, | |
| isAdmin: false, | |
| openSnackbar: false, | |
| msg: "", | |
| snackbarId: 0 , | |
| }, | |
| reducers: { | |
| login(state) { | |
| state.isLoggedIn = true; | |
| }, | |
| setAdmin(state){ | |
| state.isAdmin = true; | |
| }, | |
| logout(state) { | |
| state.isLoggedIn = false; | |
| state.isAdmin = false; | |
| }, | |
| resetSnackbar(state) { | |
| state.openSnackbar = false; | |
| state.msg = ""; | |
| } | |
| }, | |
| }); | |
| export const authActions = authSlice.actions; | |
| export const store = configureStore({ | |
| reducer: authSlice.reducer | |
| }); |