Added uiState slice
This commit is contained in:
parent
5396870d2f
commit
4877008708
@ -1,7 +1,9 @@
|
||||
import { configureStore } from "@reduxjs/toolkit";
|
||||
|
||||
import uiStateReducer from "./slices/uiState";
|
||||
|
||||
const store = configureStore({
|
||||
reducer: {},
|
||||
reducer: { uiState: uiStateReducer },
|
||||
});
|
||||
|
||||
export type RootState = ReturnType<typeof store.getState>;
|
||||
|
20
src/store/slices/uiState.ts
Normal file
20
src/store/slices/uiState.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
export const uiStateSlice = createSlice({
|
||||
name: "uiState",
|
||||
initialState: {
|
||||
addBarOpen: false,
|
||||
},
|
||||
reducers: {
|
||||
open: (state) => {
|
||||
state.addBarOpen = true;
|
||||
},
|
||||
close: (state) => {
|
||||
state.addBarOpen = false;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { open, close } = uiStateSlice.actions;
|
||||
|
||||
export default uiStateSlice.reducer;
|
Loading…
x
Reference in New Issue
Block a user