Skip to content

Commit

Permalink
Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Mar 16, 2015
1 parent bb6678d commit 90e89a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/Controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
Expand All @@ -56,7 +57,7 @@ var Controls = React.createClass({
</form>
);
},
componentDidUpdate: function(prevProps, prevState) {
componentDidUpdate: function(prevProps: Object) {
if (!_.isEqual(prevProps.range, this.props.range)) {
this.updateRangeUI();
}
Expand Down
1 change: 0 additions & 1 deletion src/TwoBit.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type SequenceRecord = {

type TwoBitHeader = {
sequenceCount: number;
reserved: number;
sequences: Array<FileIndexEntry>;
}

Expand Down
4 changes: 2 additions & 2 deletions types/types.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare class GenomeRange {
contig: string;
start: number;
stop: number; // XXX inclusive or exclusive?
start: number; // inclusive
stop: number; // inclusive
}

0 comments on commit 90e89a8

Please sign in to comment.