I am exporting a function which returns a function. Where I want to have another return statement with the previously returned function as shown.
export function fetchData(id) {
return function(dispatch) {
REST.jsonRestGet(`data/sos/${id}`, Data.prepareSosData(
(data) => {
console.log(data);
return data; // returns undefined
}))
}
}
While importing and calling this function into another component, it returns undefined.