feat: implement Redux store with slices for user, order, file, and printer management
- Added Redux store configuration in `src/store/index.ts`. - Created slices for user, order, file, and printer with respective reducers and actions. - Implemented custom hooks `useAppDispatch` and `useAppSelector` for typed Redux usage. - Defined types for file, order, printer, and user in `src/types`. - Added utility functions for formatting prices, file sizes, and dates in `src/utils`. - Created common styles and animations in `src/styles` for consistent UI design. - Integrated API request handling with token management in `src/utils/request.ts`. - Implemented local storage management for user token and info in `src/utils/storage.ts`.
This commit is contained in:
17
src/store/index.ts
Normal file
17
src/store/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { configureStore } from '@reduxjs/toolkit';
|
||||
import { userReducer } from './slices/userSlice';
|
||||
import { orderReducer } from './slices/orderSlice';
|
||||
import { fileReducer } from './slices/fileSlice';
|
||||
import { printerReducer } from './slices/printerSlice';
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
user: userReducer,
|
||||
order: orderReducer,
|
||||
file: fileReducer,
|
||||
printer: printerReducer,
|
||||
},
|
||||
});
|
||||
|
||||
export type RootState = ReturnType<typeof store.getState>;
|
||||
export type AppDispatch = typeof store.dispatch;
|
||||
Reference in New Issue
Block a user