Last active
February 29, 2020 11:13
-
-
Save Djuki/48872b8bcbfbd7f88e0c8bbda8a620f3 to your computer and use it in GitHub Desktop.
This file contains 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
// Container component map dispactch action to the presentational component props | |
const mapDispatchToProps = dispatch => { | |
return { | |
fetchMoreBranches: (identityId, nextPage) => dispatch(fetchMoreBranches(identityId, nextPage)) | |
}; | |
}; | |
const AppContainer = connect(mapStateToProps, mapDispatchToProps)(App); | |
// actions | |
export const FETCH_MORE_BRANCHES = 'FETCH_MORE_BRANCHES'; | |
export const SUCCESS_FETCH_BRANCHES = 'SUCCESS_FETCH_BRANCHES'; | |
export function fetchMoreBranches(identityId, nextPage) { | |
return { | |
type: FETCH_MORE_BRANCHES, | |
identityId, | |
nextPage | |
}; | |
} | |
export function successFetchBranches(branches, nextPage) { | |
return { | |
type: SUCCESS_FETCH_BRANCHES, | |
branches, | |
nextPage | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment