Merge pull request #65 from havfo/feat/debounce

Update packages and debounce updateDimensions
master
Håvar Aambø Fosstveit 2018-08-09 10:50:30 +02:00 committed by GitHub
commit ff5678fa1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 188 additions and 441 deletions

View File

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ResizeObserver from 'resize-observer-polyfill';
import { connect } from 'react-redux';
import debounce from 'lodash/debounce';
import classnames from 'classnames';
import * as stateActions from '../redux/stateActions';
import Peer from './Peer';
@ -59,7 +60,7 @@ class Filmstrip extends Component
return ratio;
};
updateDimensions = () =>
updateDimensions = debounce(() =>
{
const container = this.activePeerContainer.current;
@ -78,7 +79,7 @@ class Filmstrip extends Component
width
});
}
};
}, 200);
componentDidMount()
{

View File

@ -2,6 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import debounce from 'lodash/debounce';
import * as appPropTypes from './appPropTypes';
import { Appear } from './transitions';
import Peer from './Peer';
@ -23,7 +24,7 @@ class Peers extends React.Component
this.peersRef = React.createRef();
}
updateDimensions = () =>
updateDimensions = debounce(() =>
{
if (!this.peersRef.current)
{
@ -65,7 +66,7 @@ class Peers extends React.Component
peerHeight : 0.9 * y
});
}
};
}, 200);
componentDidMount()
{

607
app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,9 +23,9 @@
"prop-types": "^15.6.2",
"protoo-client": "^3.0.0",
"random-string": "^0.2.0",
"react": "^16.4.1",
"react": "^16.4.2",
"react-copy-to-clipboard": "^5.0.1",
"react-dom": "^16.4.1",
"react-dom": "^16.4.2",
"react-draggable": "^3.0.5",
"react-dropdown": "^1.5.0",
"react-redux": "^5.0.7",
@ -37,8 +37,8 @@
"redux-thunk": "^2.3.0",
"resize-observer-polyfill": "^1.5.0",
"riek": "^1.1.0",
"url-parse": "^1.4.1",
"webtorrent": "^0.101.0"
"url-parse": "^1.4.3",
"webtorrent": "^0.101.2"
},
"devDependencies": {
"babel-core": "^6.26.3",
@ -52,7 +52,7 @@
"browserify": "^16.2.2",
"del": "^3.0.0",
"envify": "^4.1.0",
"eslint": "^5.2.0",
"eslint": "^5.3.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-react": "^7.10.0",
"gulp": "^4.0.0",
@ -65,7 +65,7 @@
"gulp-rename": "^1.4.0",
"gulp-stylus": "^2.7.0",
"gulp-touch-cmd": "0.0.1",
"gulp-uglify": "^3.0.0",
"gulp-uglify": "^3.0.1",
"gulp-util": "^3.0.8",
"lodash": "^4.17.10",
"mkdirp": "^0.5.1",