1 function addTodo(itemTitle){
2 firebase.database.ref('todos').push().set({
3 title: itemTitle
4 })
5 .then((doc) => {
6 // nothing to do here since you already have a
7 // connection pulling updates to Todos
8 })
9 .catch((error) => {
10 dispatch(todoActions.showError("Error adding Todo to database"));
11 console.error(error);
12 })
13 }
14}