20 lines
413 B
JavaScript
20 lines
413 B
JavaScript
import { createSlice } from "@reduxjs/toolkit";
|
|
|
|
const initialState = {}
|
|
|
|
const authSlice = createSlice({
|
|
name: 'auth',
|
|
initialState,
|
|
reducers: {
|
|
authAdded(state, action) {
|
|
const { current_user } = action.payload;
|
|
let newState = { ...state }
|
|
newState = current_user
|
|
return newState
|
|
}
|
|
}
|
|
})
|
|
|
|
export const { authAdded } = authSlice.actions;
|
|
|
|
export default authSlice.reducer; |