Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // in action.js
- call_api = () => {
- // jquery ajax call and return promise
- return $.get(...)
- }
- // in ComponentA.js
- const mapDispatchToProps = function (dispatch) {
- return {
- doAction = () => {
- dispatch(call_api(..))
- }
- ...
- }
- ...
- }
- export const ComponentAContainer = connect(mapStateToProps, mapDispatchToProps)(ComponentA)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement