DEV Community

Discussion on: dealing with async method calls

Collapse
 
vasylnahuliak profile image
Vasyl Nahuliak

Hello. You can use async/await.

const nameYourFunction = async () => {
if (projectData.newNote) {
await addProjectNotes(addNote(projectData.newNote))
}
createProject(projectData, setIsSubmitting, submittedCallback);
}