diff --git a/src/Controls.js b/src/Controls.js index 3801d09f..c6a9879d 100644 --- a/src/Controls.js +++ b/src/Controls.js @@ -14,8 +14,7 @@ var Controls = React.createClass({ // XXX: can we be more specific than this with Flow? onChange: React.PropTypes.func.isRequired }, - makeRange: function() { - // XXX Removing the Number() should lead to type errors, but doesn't. + makeRange: function(): GenomeRange { return { contig: this.refs.contig.getDOMNode().value, start: Number(this.refs.start.getDOMNode().value), @@ -35,8 +34,10 @@ var Controls = React.createClass({ this.refs.start.getDOMNode().value = r.start; this.refs.stop.getDOMNode().value = r.stop; - var contigIdx = this.props.contigList.indexOf(r.contig); - this.refs.contig.getDOMNode().selectedIndex = contigIdx; + if (this.props.contigList) { + var contigIdx = this.props.contigList.indexOf(r.contig); + this.refs.contig.getDOMNode().selectedIndex = contigIdx; + } }, render: function(): any { var contigOptions = this.props.contigList @@ -56,7 +57,7 @@ var Controls = React.createClass({ ); }, - componentDidUpdate: function(prevProps, prevState) { + componentDidUpdate: function(prevProps: Object) { if (!_.isEqual(prevProps.range, this.props.range)) { this.updateRangeUI(); } diff --git a/src/TwoBit.js b/src/TwoBit.js index 1979e50f..d8552e7c 100644 --- a/src/TwoBit.js +++ b/src/TwoBit.js @@ -37,7 +37,6 @@ type SequenceRecord = { type TwoBitHeader = { sequenceCount: number; - reserved: number; sequences: Array; } diff --git a/types/types.js b/types/types.js index 5daabf22..3357c71d 100644 --- a/types/types.js +++ b/types/types.js @@ -1,5 +1,5 @@ declare class GenomeRange { contig: string; - start: number; - stop: number; // XXX inclusive or exclusive? + start: number; // inclusive + stop: number; // inclusive }