I have been doing a React course and I am unable to understand double arrow functions correctly. Could someone please explain me this piece of code
export const fetchDishes = () => (dispatch) => {
dispatch(dishesLoading(true));
setTimeout(() => {
dispatch(addDishes(DISHES));
}, 2000);
}
All I understood till now is that fetchDishes is a function which takes no arguments but returns another function named dispatch and the dispatch function calls itself(dispatches an action).
I am looking for a detailed explaination, bonus if you could explain a bit in terms of react too