First we enumerate our actions as constants...
const ADD_TODO = 'ADD_TODO'
Then we need to create an "action creator" somewhere: import { ADD_TODO } from '../actionTypes'
function addTodo(text) {
return {
type: ADD_TODO,
text
}
}
Then we need to import that action and dispatch it when we need it... import addTodo from './actions'
dispatch(addTodo(text))
Now even the same nonsense for reducers...