33 lines
855 B
JavaScript
33 lines
855 B
JavaScript
// // src/redux/slices/authSlice.js
|
|
// import { createSlice } from '@reduxjs/toolkit';
|
|
|
|
// const initialState = {
|
|
// token: null,
|
|
// loading: false,
|
|
// error: null,
|
|
// };
|
|
|
|
// const authSlice = createSlice({
|
|
// name: 'auth',
|
|
// initialState,
|
|
// reducers: {
|
|
// loginStart: (state) => {
|
|
// state.loading = true;
|
|
// state.error = null;
|
|
// },
|
|
// loginSuccess: (state, action) => {
|
|
// state.loading = false;
|
|
// state.token = action.payload;
|
|
// },
|
|
// loginFailure: (state, action) => {
|
|
// state.loading = false;
|
|
// state.error = action.payload;
|
|
// },
|
|
// logout: (state) => {
|
|
// state.token = null;
|
|
// },
|
|
// },
|
|
// });
|
|
|
|
// export const { loginStart, loginSuccess, loginFailure, logout } = authSlice.actions;
|
|
// export default authSlice.reducer;
|