Open AriHrannar opened 6 years ago
Instead of doing this everytime:
export const fetchSubjectsPromises = () => (dispatch: Dispatch) => { dispatch(getSubjectsPromises()); return apiGetSubjectsPromises().then( resp => resp.data && dispatch(getSubjectsPromisesSuccess(resp.data)), error => dispatch(getSubjectsPromisesFailure(error.message)) ); };
its possible to have some middleware that takes in the action types and dispatches them. Is that a good idea? Do we gain anything from doing that?
Description
Instead of doing this everytime:
its possible to have some middleware that takes in the action types and dispatches them. Is that a good idea? Do we gain anything from doing that?