File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -103,14 +103,9 @@ export default class ViewportProvider extends React.PureComponent {
103
103
super ( props ) ;
104
104
this . scrollState = createInitScrollState ( ) ;
105
105
this . dimensionsState = createInitDimensionsState ( ) ;
106
- this . handleScroll = throttle ( this . handleScroll , 16 , {
107
- leading : true ,
108
- trailing : false ,
109
- } ) ;
110
- this . handleResize = debounce ( this . handleResize , 80 ) ;
111
106
}
112
107
113
- handleScroll = ( ) => {
108
+ handleScroll = throttle ( ( ) => {
114
109
const { x, y } = getNodeScroll ( ) ;
115
110
const {
116
111
xDir : prevXDir ,
@@ -130,13 +125,16 @@ export default class ViewportProvider extends React.PureComponent {
130
125
131
126
this . scrollState . x = x ;
132
127
this . scrollState . y = y ;
133
- } ;
128
+ } , 16 , {
129
+ leading : true ,
130
+ trailing : false ,
131
+ } ) ;
134
132
135
- handleResize = ( ) => {
133
+ handleResize = debounce ( ( ) => {
136
134
const { width, height } = getClientDimensions ( ) ;
137
135
this . dimensionsState . width = width ;
138
136
this . dimensionsState . height = height ;
139
- } ;
137
+ } , 80 ) ;
140
138
141
139
componentDidMount ( ) {
142
140
window . addEventListener ( 'scroll' , this . handleScroll , false ) ;
You can’t perform that action at this time.
0 commit comments