DEV Community

loading...

Discussion on: dealing with async method calls

Collapse
vasylnahuliak profile image
vasylnahuliak

Hello. You can use async/await.

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