Skip to content

Commit

Permalink
passes flow checks
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Mar 9, 2015
1 parent 3c8f5f6 commit f264937
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions lib/underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
declare module "underscore" {
declare function findWhere<T>(list: Array<T>, properties: {}): ?T;
declare function clone<T>(obj: T): T;

declare function isEqual<S, T>(a: S, b: T): boolean;
declare function range(a: number, b: number): Array<number>;
declare function extend(...o: Object): Object;

declare function chain<S>(obj: S): any;
}

6 changes: 4 additions & 2 deletions src/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
var React = require('react'),
Controls = require('./Controls'),
GenomeTrack = require('./GenomeTrack'),
types = require('./types');
// TODO: make this an "import type" when react-tools 0.13.0 is out.
TwoBitDataSource = require('./TwoBitDataSource'),
types = require('./types');


var Root = React.createClass({
propTypes: {
Expand All @@ -22,7 +24,7 @@ var Root = React.createClass({
},
componentDidMount: function() {
// Note: flow is unable to infer this type through `this.propTypes`.
var source: TwoBitDataSource = this.props.referenceSource;
var source = this.props.referenceSource;
source.needContigs();

source.on('contigs', () => { this.update() })
Expand Down
6 changes: 5 additions & 1 deletion src/TwoBitDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@
var Events = require('backbone').Events,
_ = require('underscore');

// TODO: make this an "import type" when react-tools 0.13.0 is out.
var TwoBit = require('./TwoBit');

// Factor by which to over-request data from the network.
// If a range of 100bp is shown and this is 2.0, then 300 base pairs will be
// requested over the network (100 * 2.0 too much)
var EXPANSION_FACTOR = 2.0;


var createTwoBitDataSource = function(remoteSource: TwoBit) {
// TODO: make the return type more precise
var createTwoBitDataSource = function(remoteSource: TwoBit): any {
// Local cache of genomic data.
var contigList = [];
var basePairs = {}; // contig -> locus -> letter
Expand Down

0 comments on commit f264937

Please sign in to comment.