OSD-Frontend/src/coreSlice.js

18 lines
447 B
JavaScript
Raw Normal View History

2020-12-20 20:19:50 +01:00
import { createSlice } from "@reduxjs/toolkit";
export const coreSlice = createSlice({
name: "core",
initialState: {
plugin: false,
data: {}
},
reducers: {
setPlugin: (state, action) => ({...state, plugin: action.payload}),
setData: (state, action) => ({...state, data: action.payload}),
}
});
export const { setPlugin, setData } = coreSlice.actions;
export const selectCore = state => state.core;
export default coreSlice.reducer;