tunny
0
Q:

storing data firebase react

    function addTodo(itemTitle){
        firebase.database.ref('todos').push().set({
            title: itemTitle
        })
        .then((doc) => {
            // nothing to do here since you already have a 
            // connection pulling updates to Todos
        })
        .catch((error) => {
            dispatch(todoActions.showError("Error adding Todo to database"));
			console.error(error);
		})
    }
}
1

New to Communities?

Join the community