via axios
But I wish to use the async await pattern.
So for the following code:
onSubmit = (params, config) => {
axios.post(LOGIN_URL, params, config)
.then(res => console.log(res.data))
.catch(e => console.log(e));
};
How would you convert this into a code that satisfies async/await pattern?
Thanks ^.^
onSubmit = (params, config) => axios.post(LOGIN_URL, params, config) .then(res => res.data);
Обсуждают сегодня