mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
527 B
TypeScript
30 lines
527 B
TypeScript
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
|
|
export interface DragState {
|
|
/**
|
|
* 拖拽
|
|
*/
|
|
isDraging:boolean
|
|
|
|
}
|
|
|
|
const initialState: DragState = {
|
|
isDraging: false,
|
|
};
|
|
|
|
const globalSlice = createSlice({
|
|
name: 'global',
|
|
initialState,
|
|
reducers: {
|
|
setDragStatus(
|
|
state,
|
|
action: PayloadAction<DragState['isDraging']>
|
|
) {
|
|
state.isDraging = action.payload;
|
|
},
|
|
},
|
|
});
|
|
|
|
export const dragActions = globalSlice.actions;
|
|
export const dragReducer = globalSlice.reducer;
|