intersection_observer_article_container.js 541 B

1234567891011121314151617
  1. import { connect } from 'react-redux';
  2. import IntersectionObserverArticle from '../components/intersection_observer_article';
  3. import { setHeight } from '../actions/height_cache';
  4. const makeMapStateToProps = (state, props) => ({
  5. cachedHeight: state.getIn(['height_cache', props.saveHeightKey, props.id]),
  6. });
  7. const mapDispatchToProps = (dispatch) => ({
  8. onHeightChange (key, id, height) {
  9. dispatch(setHeight(key, id, height));
  10. },
  11. });
  12. export default connect(makeMapStateToProps, mapDispatchToProps)(IntersectionObserverArticle);