Guest User

Untitled

a guest
Feb 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. export interface LoginModalContainerProps {
  2.  
  3. }
  4.  
  5. export interface WithStateProps {
  6. isLoggedIn: boolean;
  7. }
  8.  
  9. export interface WithDispatchProps {
  10. login(data: LoginActionOptions): void;
  11. }
  12.  
  13. export type WithReduxResult = WithStateProps & WithDispatchProps & LoginModalContainerProps;
  14.  
  15. const mapStateToProps = (state: StoreState, ownProps: LoginModalContainerProps): WithStateProps => ({
  16. isLoggedIn: state.auth.loggedIn
  17. });
  18.  
  19. const mapDispatchToProps = (dispatch: Dispatch<{}>): WithDispatchProps => ({
  20. login: (data: LoginActionOptions) => dispatch(login(data))
  21. });
  22.  
  23. export const LoginModalContainer = connect<WithStateProps, WithDispatchProps, LoginModalContainerProps>(mapStateToProps, mapDispatchToProps)(LoginModal)
Add Comment
Please, Sign In to add comment