Arrow Functions
Old School
function add(a, b) {
return a + b;
}
Basic Usage
const add = (a, b) => {
return a + b
}
Alternate Usage
I can remove braces to make flatter as compact and clean code.
const add = (a, b) => a+b
Complex Usage
In this example, I created an arrow function for signup.
const signup = dispatch => async ({ email, password }) => {
//business logic
}