So I have an app that relies on redux-thunk and an express backend. Would it be considered good practice to fetch data and make a post request at the same time?
Here is a code example:
export const getProducts = () => async (dispatch) => {
const { data } = await API.getProducts();
dispatch({ type: 'GET_PRODUCTS', payload: data });
};
export const createProduct = (proData) => async (dispatch) => {
const { data, status } = await API.createProduct(proData);
if (status === 200) {
dispatch(getProducts());
}
};