Skip to content

Instantly share code, notes, and snippets.

@talyssonoc
Last active May 16, 2019 13:49
Show Gist options
  • Save talyssonoc/fcf0c363ebb518d1cd5628f41c2bcc5d to your computer and use it in GitHub Desktop.
Save talyssonoc/fcf0c363ebb518d1cd5628f41c2bcc5d to your computer and use it in GitHub Desktop.
const loadProductsAction = () => (dispatch, _, container) => {
dispatch(showSpinner());
container.loadProducts({
onSuccess: (products) => {
dispatch(receiveProducts(products));
dispatch(hideSpinner());
},
onError: (error) => {
dispatch(loadProductsError(error));
dispatch(hideSpinner());
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment