Answers for "storing data firebase react"

1

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);
		})
    }
}
Posted by: Guest on September-12-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language