You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
369 B

  1. import { injectIntl } from 'react-intl';
  2. import { connect } from 'react-redux';
  3. // Connects a component.
  4. export function wrap (Component, mapStateToProps, mapDispatchToProps, options) {
  5. const withIntl = typeof options === 'object' ? options.withIntl : !!options;
  6. return (withIntl ? injectIntl : i => i)(connect(mapStateToProps, mapDispatchToProps)(Component));
  7. }