Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-2]\\|[0-9]\\).[0-9
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy

[version]
0.12.0
0.13.1
7 changes: 4 additions & 3 deletions Examples/Movies/SearchScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var {
} = React;
var TimerMixin = require('react-timer-mixin');

var invariant = require('invariant');

var MovieCell = require('./MovieCell');
var MovieScreen = require('./MovieScreen');

Expand Down Expand Up @@ -73,18 +75,16 @@ var SearchScreen = React.createClass({
this.searchMovies('');
},

_urlForQueryAndPage: function(query: string, pageNumber: ?number): string {
_urlForQueryAndPage: function(query: string, pageNumber: number): string {
var apiKey = API_KEYS[this.state.queryNumber % API_KEYS.length];
if (query) {
return (
// $FlowFixMe(>=0.13.0) - pageNumber may be null or undefined
API_URL + 'movies.json?apikey=' + apiKey + '&q=' +
encodeURIComponent(query) + '&page_limit=20&page=' + pageNumber
);
} else {
// With no query, load latest movies
return (
// $FlowFixMe(>=0.13.0) - pageNumber may be null or undefined
API_URL + 'lists/movies/in_theaters.json?apikey=' + apiKey +
'&page_limit=20&page=' + pageNumber
);
Expand Down Expand Up @@ -176,6 +176,7 @@ var SearchScreen = React.createClass({
});

var page = resultsCache.nextPageNumberForQuery[query];
invariant(page != null, 'Next page number for "%s" is missing', query);
fetch(this._urlForQueryAndPage(query, page))
.then((response) => response.json())
.catch((error) => {
Expand Down
2 changes: 1 addition & 1 deletion Examples/SampleApp/_flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ node_modules/react-native/Libraries/react-native/react-native-interface.js
module.system=haste

[version]
0.12.0
0.13.1