我的朋友们,我开发了 react redux 工具包,一切正常,但是在函数调度中不起作用发送到 react-dom.development.js 中的 dispatchUserBlockingUpdate 函数我的问题在哪里?
我看 changeProfitSortType 函数在需要发送 dispatch(changeProfitSort) 时获取数据不起作用!
这是:sortingSlice.js
import {createSlice} from "@reduxjs/toolkit";
export const sortingSlice = createSlice({
name: 'sorting',
initialState: {
profitSortType: false,
},
reducers: {
changeProfitSort: (state, action) => {
state.profitSortType = action.payload;
//return { ...state, profitSortType: action.payload }
},
},
});
export const { changeProfitSort } = sortingSlice.actions;
export const changeProfitSortType = (data) => async dispatch => {
console.log(data);
let status = data.status;
console.log(status);
await dispatch(changeProfitSort(status));
}
export default sortingSlice.reducer;