feat : formating code by prettier
This commit is contained in:
23
src/redux/slices/categoryId.ts
Normal file
23
src/redux/slices/categoryId.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
interface categoryIdState {
|
||||
id: number;
|
||||
}
|
||||
|
||||
const initialState: categoryIdState = {
|
||||
id: 0,
|
||||
};
|
||||
|
||||
const categoryIdSlice = createSlice({
|
||||
name: "categoryId",
|
||||
initialState,
|
||||
reducers: {
|
||||
setCategoryId: (state, action: PayloadAction<number>) => {
|
||||
state.id = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setCategoryId } = categoryIdSlice.actions;
|
||||
|
||||
export default categoryIdSlice.reducer;
|
||||
Reference in New Issue
Block a user