I have the following actions code:
let nextTodoId = 0
export const addTodo = text => ({
type: 'ADD_TODO',
id: nextTodoId++,
text
})
export const setVisibilityFilter = filter => ({
type: 'SET_VISIBILITY_FILTER',
filter
})
export const toggleTodo = id => ({
type: 'TOGGLE_TODO',
id
})
export const getResult = () => { type: 'GET_RESULT' }
export const VisibilityFilters = {
SHOW_ALL: 'SHOW_ALL',
SHOW_COMPLETED: 'SHOW_COMPLETED',
SHOW_ACTIVE: 'SHOW_ACTIVE'
}
when "getResult" gets dispatched I get this error: "actions must be plain objects".
Am I not returning an object like this?
export const getResult = () => { type: 'GET_RESULT' }
If I change the above to:
export const getResult = { type: 'GET_RESULT' }
then it's all good
even after modifying the code with the possible solutions, I am still getting the error