let api = 'https://api.mockable.io/api/v1/stuff';
export const get = () => dispatch => {
return utils.fetchData(api).then(records => {
dispatch(getAction(records));
});
};
const getAction = payload => {
return {
type: 'GET',
payload: payload,
};
};
thunk middlewareexport default store => next => action =>
typeof action === 'function'
? action(store.dispatch, store.getState)
: next(action);
func store => next => action => more is curried. They happen in sequence