У меня есть приложение React JS с избыточностью и программным обеспечением epicmiddle для реализации, но при попытке получить сообщение: Error: Actions may not have an undefined "type" property. Have you misspelled a constant?
Home. js
import {competitionShuffleGetAllAction} from "../../actions/competitionActions"
class Home extends Component {
componentDidMount(){
this.props.competitionShuffleGetAllAction()
}
}
export default connect(mapStateToProps, {
competitionShuffleGetAllAction
})(Home);
CompetitionActions. js
import { COMPETITION_SHUFFLE_GET_ALL } from "../constants/actionTypes";
const competitionShuffleGetAllAction = () => {
return {
type: COMPETITION_SHUFFLE_GET_ALL
}
}
export {
competitionShuffleGetAllAction
}
actionTypes. js
export const COMPETITION_SHUFFLE_GET_ALL = 'COMPETITION_SHUFFLE_GET_ALL'
CompetitionEpi c. js
....
const competitionShuffleGetAllEpic = (action$) => {
return action$.pipe(
ofType(COMPETITION_SHUFFLE_GET_ALL),
mergeMap(() => {
return competitionService.getShuffleComp()
})
)
}
export default {
competitionShuffleGetAllEpic
}
Редукторы. js
export default (state = initState, action) => {
switch(action.type){
case COMPETITION_SHUFFLE_GET_ALL:
return{
...state
}
default:
return state
}
}
Что с этим не так? : ((