import {createSlice} from '@reduxjs/toolkit'; const initialState = { people: {}, load: false, page: 0 }; export const peopleSlice = createSlice({ name: 'people', initialState, reducers: { reducerGetPeople: (state, action) => { state.people = action.payload state.load = false }, reducerSetPage: (state, action) => { state.page = action.payload }, reducerGetPeopleLoad: (state) => { state.load = true }, }, }); export const { reducerGetPeople, reducerGetPeopleLoad, reducerSetPage } = peopleSlice.actions; export default peopleSlice.reducer;
Does actionGetPeople function return smth ? actually can u use void in actionGetPeople function to return
Обсуждают сегодня