Spaces:
Paused
Paused
Download client/src/store/modalSlice.js from arabdullah/chatty: direct link, hf CLI and curl.
- Browser
- Download file 637 Bytes
-
https://huggingface.co/spaces/arabdullah/chatty/resolve/main/client/src/store/modalSlice.js
- Command line
-
hf download hf://spaces/arabdullah/chatty/client/src/store/modalSlice.js
-
curl -L -o modalSlice.js https://huggingface.co/spaces/arabdullah/chatty/resolve/main/client/src/store/modalSlice.js
637 Bytes
| import { createSlice } from "@reduxjs/toolkit"; | |
| const initialState = { | |
| type: "", | |
| visible: false, | |
| positions: {}, | |
| payload: {}, | |
| }; | |
| const modalSlice = createSlice({ | |
| name: "modal", | |
| initialState, | |
| reducers: { | |
| closeModal: (state, { payload }) => { | |
| console.log(payload); | |
| state.type = null; | |
| state.positions = {}; | |
| state.payload = {}; | |
| }, | |
| openModal: (state, { payload }) => { | |
| state.type = payload.type; | |
| state.positions = payload.positions; | |
| state.payload = payload.payload || {}; | |
| }, | |
| }, | |
| }); | |
| export const modalActions = modalSlice.actions; | |
| export default modalSlice.reducer; | |