Merge pull request #65 from havfo/feat/debounce
Update packages and debounce updateDimensionsmaster
commit
ff5678fa1b
|
|
@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ResizeObserver from 'resize-observer-polyfill';
|
import ResizeObserver from 'resize-observer-polyfill';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import debounce from 'lodash/debounce';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import * as stateActions from '../redux/stateActions';
|
import * as stateActions from '../redux/stateActions';
|
||||||
import Peer from './Peer';
|
import Peer from './Peer';
|
||||||
|
|
@ -59,7 +60,7 @@ class Filmstrip extends Component
|
||||||
return ratio;
|
return ratio;
|
||||||
};
|
};
|
||||||
|
|
||||||
updateDimensions = () =>
|
updateDimensions = debounce(() =>
|
||||||
{
|
{
|
||||||
const container = this.activePeerContainer.current;
|
const container = this.activePeerContainer.current;
|
||||||
|
|
||||||
|
|
@ -78,7 +79,7 @@ class Filmstrip extends Component
|
||||||
width
|
width
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
}, 200);
|
||||||
|
|
||||||
componentDidMount()
|
componentDidMount()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
import debounce from 'lodash/debounce';
|
||||||
import * as appPropTypes from './appPropTypes';
|
import * as appPropTypes from './appPropTypes';
|
||||||
import { Appear } from './transitions';
|
import { Appear } from './transitions';
|
||||||
import Peer from './Peer';
|
import Peer from './Peer';
|
||||||
|
|
@ -23,7 +24,7 @@ class Peers extends React.Component
|
||||||
this.peersRef = React.createRef();
|
this.peersRef = React.createRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateDimensions = () =>
|
updateDimensions = debounce(() =>
|
||||||
{
|
{
|
||||||
if (!this.peersRef.current)
|
if (!this.peersRef.current)
|
||||||
{
|
{
|
||||||
|
|
@ -65,7 +66,7 @@ class Peers extends React.Component
|
||||||
peerHeight : 0.9 * y
|
peerHeight : 0.9 * y
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
}, 200);
|
||||||
|
|
||||||
componentDidMount()
|
componentDidMount()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -23,9 +23,9 @@
|
||||||
"prop-types": "^15.6.2",
|
"prop-types": "^15.6.2",
|
||||||
"protoo-client": "^3.0.0",
|
"protoo-client": "^3.0.0",
|
||||||
"random-string": "^0.2.0",
|
"random-string": "^0.2.0",
|
||||||
"react": "^16.4.1",
|
"react": "^16.4.2",
|
||||||
"react-copy-to-clipboard": "^5.0.1",
|
"react-copy-to-clipboard": "^5.0.1",
|
||||||
"react-dom": "^16.4.1",
|
"react-dom": "^16.4.2",
|
||||||
"react-draggable": "^3.0.5",
|
"react-draggable": "^3.0.5",
|
||||||
"react-dropdown": "^1.5.0",
|
"react-dropdown": "^1.5.0",
|
||||||
"react-redux": "^5.0.7",
|
"react-redux": "^5.0.7",
|
||||||
|
|
@ -37,8 +37,8 @@
|
||||||
"redux-thunk": "^2.3.0",
|
"redux-thunk": "^2.3.0",
|
||||||
"resize-observer-polyfill": "^1.5.0",
|
"resize-observer-polyfill": "^1.5.0",
|
||||||
"riek": "^1.1.0",
|
"riek": "^1.1.0",
|
||||||
"url-parse": "^1.4.1",
|
"url-parse": "^1.4.3",
|
||||||
"webtorrent": "^0.101.0"
|
"webtorrent": "^0.101.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.26.3",
|
"babel-core": "^6.26.3",
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
"browserify": "^16.2.2",
|
"browserify": "^16.2.2",
|
||||||
"del": "^3.0.0",
|
"del": "^3.0.0",
|
||||||
"envify": "^4.1.0",
|
"envify": "^4.1.0",
|
||||||
"eslint": "^5.2.0",
|
"eslint": "^5.3.0",
|
||||||
"eslint-plugin-import": "^2.13.0",
|
"eslint-plugin-import": "^2.13.0",
|
||||||
"eslint-plugin-react": "^7.10.0",
|
"eslint-plugin-react": "^7.10.0",
|
||||||
"gulp": "^4.0.0",
|
"gulp": "^4.0.0",
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
"gulp-rename": "^1.4.0",
|
"gulp-rename": "^1.4.0",
|
||||||
"gulp-stylus": "^2.7.0",
|
"gulp-stylus": "^2.7.0",
|
||||||
"gulp-touch-cmd": "0.0.1",
|
"gulp-touch-cmd": "0.0.1",
|
||||||
"gulp-uglify": "^3.0.0",
|
"gulp-uglify": "^3.0.1",
|
||||||
"gulp-util": "^3.0.8",
|
"gulp-util": "^3.0.8",
|
||||||
"lodash": "^4.17.10",
|
"lodash": "^4.17.10",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue