I'm quite new to async/await and would like to know, what is the best way to refactor the below code with async/await?
export const createUser = (values, history) => {
return dispatch => {
axios.post('/api/signup', values)
.then(res => {
console.log('result', res);
}, rej => {
console.log('rejection', rej);
});
}
}
When only one argument is provided to .then
it is pretty straightforward to me, but what happens if you have two arguments like here instead?