mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Optimize constructors
This commit is contained in:
@@ -7,6 +7,7 @@ import { MountFixed, MountGimballed, MountTurret } from './SvgIcons';
|
||||
import FuzzySearch from 'react-fuzzy';
|
||||
import { getModuleInfo } from 'ed-forge/lib/data/items';
|
||||
import { groupBy, mapValues, sortBy } from 'lodash';
|
||||
import autoBind from 'auto-bind';
|
||||
|
||||
const PRESS_THRESHOLD = 500; // mouse/touch down threshold
|
||||
|
||||
@@ -36,8 +37,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
*/
|
||||
constructor(props, context) {
|
||||
super(props);
|
||||
this._hideDiff = this._hideDiff.bind(this);
|
||||
this._showSearch = this._showSearch.bind(this);
|
||||
autoBind(this);
|
||||
this.state = this._initState(props, context);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import ContainerDimensions from 'react-container-dimensions';
|
||||
import * as d3 from 'd3';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import autoBind from 'auto-bind';
|
||||
|
||||
const MARGIN = { top: 15, right: 20, bottom: 35, left: 60 };
|
||||
|
||||
@@ -44,13 +45,7 @@ export default class LineChart extends TranslatedComponent {
|
||||
*/
|
||||
constructor(props, context) {
|
||||
super(props);
|
||||
|
||||
this._updateDimensions = this._updateDimensions.bind(this);
|
||||
this._updateSeries = this._updateSeries.bind(this);
|
||||
this._tooltip = this._tooltip.bind(this);
|
||||
this._showTip = this._showTip.bind(this);
|
||||
this._hideTip = this._hideTip.bind(this);
|
||||
this._moveTip = this._moveTip.bind(this);
|
||||
autoBind(this);
|
||||
|
||||
const series = props.series;
|
||||
|
||||
|
||||
@@ -11,14 +11,6 @@ export default class ModalHelp extends TranslatedComponent {
|
||||
title: PropTypes.string
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param {Object} props React Component properties
|
||||
*/
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the modal
|
||||
* @return {React.Component} Modal Content
|
||||
|
||||
@@ -27,7 +27,7 @@ export default class ShipPicker extends TranslatedComponent {
|
||||
* @param {object} props Properties react
|
||||
* @param {object} context react context
|
||||
*/
|
||||
constructor(props, context) { // eslint-disable-line
|
||||
constructor(props, context) {
|
||||
super(props);
|
||||
autoBind(this);
|
||||
this.state = { menuOpen: false };
|
||||
|
||||
Reference in New Issue
Block a user