1
0
Fork 0
forked from gitea/nas

remove legacy decorators, use lodash.debounce (#2830)

This commit is contained in:
Nolan Lawson 2017-05-06 02:05:32 -07:00 committed by Eugen Rochko
parent 494945ff4f
commit 553e13144f
6 changed files with 14 additions and 39 deletions

View file

@ -3,7 +3,7 @@ import StatusList from '../../../components/status_list';
import { expandTimeline, scrollTopTimeline } from '../../../actions/timelines';
import Immutable from 'immutable';
import { createSelector } from 'reselect';
import { debounce } from 'react-decoration';
import { debounce } from 'lodash';
const makeGetStatusIds = () => createSelector([
(state, { type }) => state.getIn(['settings', type], Immutable.Map()),
@ -53,21 +53,18 @@ const makeMapStateToProps = () => {
const mapDispatchToProps = (dispatch, { type, id }) => ({
@debounce(300, true)
onScrollToBottom () {
onScrollToBottom: debounce(() => {
dispatch(scrollTopTimeline(type, false));
dispatch(expandTimeline(type, id));
},
}, 300, {leading: true}),
@debounce(100)
onScrollToTop () {
onScrollToTop: debounce(() => {
dispatch(scrollTopTimeline(type, true));
},
}, 100),
@debounce(100)
onScroll () {
onScroll: debounce(() => {
dispatch(scrollTopTimeline(type, false));
}
}, 100)
});