Last active
May 16, 2019 13:49
-
-
Save talyssonoc/1e3a496c9deee6ef5f9c8d4299adbf88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const loadProductsAction = () => (dispatch, _, container) => { | |
dispatch(showSpinner()); | |
container.loadProducts({ | |
onSuccess: (products) => { | |
dispatch(receiveProducts(products)); | |
dispatch(hideSpinner()); | |
}, | |
onError: (error) => { | |
dispatch(loadProductsError(error)); | |
dispatch(hideSpinner()); | |
} | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const refreshProductsAction = () => (dispatch, _, container) => { | |
container.loadProducts({ | |
onSuccess: (products) => { | |
dispatch(refreshProducts(products)); | |
}, | |
onError: (error) => { | |
dispatch(loadProductsError(error)); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment