'Purpose of using arrow function and function keyword syntax together?
First .then method is using arrow function syntax and the second .then method is using the function keyword syntax. Is this just inconsistent coding style or does it have a purpose?
store
.dispatch(Actions.LOGIN, values)
.then(() => {
Swal.fire({
text: "Sucess!",
icon: "success",
buttonsStyling: false,
confirmButtonText: "Ok!",
customClass: {
confirmButton: "btn fw-bold btn-light-primary",
},
}).then(function () {
// Go to page after successfully login
router.push({ name: "dashboard" });
});
})
Solution 1:[1]
No, it is not just inconsistency here you can read more.
And some cases you can not use arrow functions.
Also, without a webpack etc or some kind of packager it may not work for all browsers.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
