DEV Community

loading...

Discussion on: Fetch vs. Axios - comparison

Collapse
_danieldev profile image
Daniel Michael 👨‍💻

Also I think people should start using try catch instead of .then and .catch

Collapse
michaelcurrin profile image
Michael

.catch is needed to work with promises to get the expected flow.

You can use try catch but then you need to use the async function syntax. See code samples here.

dev.to/annarankin/finally-in-promi...