2020-03-27 13:59:38 -07:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import IntersectionObserverArticle from '../components/intersection_observer_article';
|
|
|
|
import { setHeight } from '../actions/height_cache';
|
|
|
|
|
|
|
|
const makeMapStateToProps = (state, props) => ({
|
|
|
|
cachedHeight: state.getIn(['height_cache', props.saveHeightKey, props.id]),
|
|
|
|
});
|
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|
2020-04-14 14:47:35 -07:00
|
|
|
onHeightChange(key, id, height) {
|
2020-03-27 13:59:38 -07:00
|
|
|
dispatch(setHeight(key, id, height));
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(makeMapStateToProps, mapDispatchToProps)(IntersectionObserverArticle);
|