How to use the react-redux.connect function in react-redux

To help you get started, we’ve selected a few react-redux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github coderoad / atom-coderoad-deprecated / src / components / Tutorials / SelectTutorial / index.tsx View on Github external
}
  private displayName(name: string): string {
    switch (true) {
      case !!name.match(/^coderoad-tutorial-/): return name.slice(18);
      case !!name.match(/^coderoad-/): return name.slice(9);
      default: return name;
    }
  }
}

const mapStateToProps = (state, props) => ({
  tutorial: props.tutorial
});
const mapDispatchToProps = {tutorialSet};

export default connect(mapStateToProps, mapDispatchToProps)(SelectTutorial);
github jspsych / jsPsych-Redux-GUI / src / common / containers / Login / VerificationWindow / index.js View on Github external
import { connect } from 'react-redux';
//import * as userMenuActions from '../../../actions/userMenuActions';
import VerificationWindow from '../../../components/Login/VerificationWindow';

const mapStateToProps = (state, ownProps) => {
  return {
  }
}

const mapDispatchToProps = (dispatch, ownProps) => ({

})

export default connect(mapStateToProps, mapDispatchToProps)(VerificationWindow);
github ModusCreateOrg / budgeting / app / containers / Spending / index.js View on Github external
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';

import { sortTransactions, getOutflowByCategoryName } from 'selectors/transactions';

import DonutChart from 'components/DonutChart';

@connect(state => ({
  data: sortTransactions(getOutflowByCategoryName(state)),
}))
class Spending extends Component {
  static propTypes = {
    data: PropTypes.array.isRequired,
  };

  render() {
    const { data } = this.props;

    return ;
  }
}

export default Spending;
github trynmaps / metrics-mvp / frontend / src / components / MareyChart.jsx View on Github external
}

const mapStateToProps = state => ({
  routes: state.routes.data,
  graphParams: state.graphParams,
  arrivals: state.arrivals.data,
  arrivalsErr: state.arrivals.error,
});

const mapDispatchToProps = dispatch => {
  return {
    fetchArrivals: params => dispatch(fetchArrivals(params)),
  };
};

export default connect(mapStateToProps, mapDispatchToProps)(MareyChart);
github Chainers / steepshot-web / src / components / Modals / Promote / Promote.js View on Github external
pushMessage: (message) => {
			dispatch(pushMessage(message));
		},
		searchingBotRequest: () => {
			dispatch(searchingBotRequest());
		},
		addPostIndex: (postIndex) => {
			dispatch(addPostIndex(postIndex));
		},
		getAuthUserInfoError: (error) => {
			dispatch(getAuthUserInfoError(error));
		}
	}
};

export default connect(mapStateToProps, mapDispatchToProps)(Promote);
github appirio-tech / connect-app / src / routes / metadata / containers / ProjectTypesContainer.jsx View on Github external
const mapDispatchToProps = {
  loadProjectsMetadata,
  sortProjectTypes,
}

const page500 = compose(
  withProps({code:500})
)
const showErrorMessageIfError = hasLoaded =>
  branch(hasLoaded, renderComponent(page500(CoderBot)), t => t)
const errorHandler = showErrorMessageIfError(props => props.error)
const enhance = spinnerWhileLoading(props => !props.isLoading || props.templates)
const ProjectTypesContainerWithLoaderEnhanced = enhance(errorHandler(ProjectTypesContainer))
const ProjectTypesContainerWithLoaderAndAuth = requiresAuthentication(ProjectTypesContainerWithLoaderEnhanced)

export default withRouter(connect(mapStateToProps, mapDispatchToProps)(ProjectTypesContainerWithLoaderAndAuth))
github Paratii-Video / paratii-portal / src / scripts / containers / ProfileContainer.js View on Github external
import Profile from 'components/Profile'

import type { RootState } from 'types/ApplicationTypes'

const mapStateToProps = (state: RootState) => ({
  user: getUser(state),
  userAddress: getUserAddress(state),
  isWalletSecured: getIsSecure(state)
})

const mapDispatchToProps = dispatch => ({
  showNotification: bindActionCreators(show, dispatch),
  checkUserWallet: bindActionCreators(checkUserWallet, dispatch)
})

export default connect(mapStateToProps, mapDispatchToProps)(Profile)
github Cryptonomic / Arronax / src / components / ValueInputItem / index.tsx View on Github external
)
    
  }
}

const mapStateToProps = (state: any) => ({

});

const mapDispatchToProps = (dispatch: any) => ({
  fetchValues: (attribute: string, value: string) => dispatch(getHightCardinalityValues(attribute, value)),
});

export default compose(
  withStyles(styles),
  connect(
    mapStateToProps,
    mapDispatchToProps
  )
)(withTranslation()(InputItem));
github TarikHuber / react-most-wanted / packages / rmw-shell / src / pages / Users / Users.js View on Github external
'users',
    filters,
    getList(state, path),
    fieldValue => fieldValue.val
  )

  return {
    isSelecting,
    hasFilters,
    isLoading: isLoading(state, path),
    list,
    auth,
  }
}

export default connect(mapStateToProps, { ...filterActions })(
  injectIntl(withTheme(withFirebase(withRouter(Users))))
)
github lovemecomputer / bramble / app / components / Header.js View on Github external
{/*<h1 id="app-title">bramble</h1>
          <span>
            📄 {this.props.bramble.projectName}
          </span>*/}
          <div>
            <a>save</a>
            <a>open</a>
            <a>new</a>
          </div>
        
      
    );
  }
}

export default connect(stateReturn.allState)(Header);