22 lines
544 B
JavaScript
22 lines
544 B
JavaScript
import { createSlice } from "@reduxjs/toolkit";
|
|
|
|
const globalVariablesSlice = createSlice({
|
|
name: "globalVariables",
|
|
initialState: {
|
|
loginUser:null
|
|
},
|
|
reducers: {
|
|
setGlobalVariable: (state, action) => {
|
|
const { key, value } = action.payload;
|
|
state[key] = value;
|
|
},
|
|
setLoginUserPermmisions: ( state, action ) =>
|
|
{
|
|
state.loginUser = action.payload
|
|
}
|
|
},
|
|
});
|
|
|
|
export const { setGlobalVariable,setLoginUserPermmisions } = globalVariablesSlice.actions;
|
|
export default globalVariablesSlice.reducer;
|