This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // userSlice.js | |
| import { createSlice } from "@reduxjs/toolkit"; | |
| const initialState = { | |
| userData: {}, | |
| loading: true, | |
| error: null, | |
| }; | |
| const userSlice = createSlice({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use client"; | |
| import React from "react"; | |
| import { Provider } from "react-redux"; | |
| import store from "./Store"; | |
| const CustomProvider = ({ children }) => { | |
| return <Provider store={store}>{children}</Provider>; | |
| }; | |
| export default CustomProvider; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use client"; | |
| import { configureStore } from "@reduxjs/toolkit"; | |
| import userReducer from "./features/userSlice"; | |
| const store = configureStore({ | |
| reducer: { | |
| user: userReducer, | |
| }, | |
| }); |
NewerOlder