This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filterMovies: function() { | |
var moviePosters = []; | |
for (var i; i <= 5; i++) { | |
if(apiData.rating >= 8) { | |
return moviePosters.push(apiData.Poster); | |
} else { | |
return; | |
} | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Search = require('./Search.jsx') | |
var Img = require('./Img.jsx'); | |
var Info = require('./Info.jsx'); | |
var UI = React.createClass({ | |
getInitialState: function() { | |
return { | |
people: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Search = React.createClass({ | |
getInitialState: function() { | |
return { | |
value: '', | |
isExpanded: false | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Search = React.createClass({ | |
getInitialState: function() { | |
return { | |
value: '', | |
isExpanded: false | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET file:///C:/Users/Zack/Desktop/ReelFetch/client/vendor.bundle.js net::ERR_FILE_NOT_FOUND | |
index.html:11 GET file:///C:/Users/Zack/Desktop/ReelFetch/client/bundle.js net::ERR_FILE_NOT_FOUND |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidMount: function() { | |
fetch('http://swapi.co/api/people') | |
.then(function(response) { | |
return response.json | |
}) | |
.then(function(json) { | |
this.setState({ people: json }); | |
}.bind(this)) | |
.catch(function(err) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Search = require('./Search.jsx') | |
var Img = require('./Img.jsx'); | |
var Info = require('./Info.jsx'); | |
var UI = React.createClass({ | |
getInitialState: function() { | |
return { | |
people: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// THIS WILL RETURN API JSON DATA BEFORE FIRST RENDER | |
componentDidMount: function() { | |
fetch('http://swapi.co/api/people') | |
.then(function(response) { | |
return response.json | |
}) | |
.then(function(json) { | |
this.setState({ data: json }); | |
}) | |
.catch(function(err) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// THIS WILL RETURN API JSON DATA BEFORE FIRST RENDER | |
componentDidMount: function() { | |
fetch('http://swapi.co/api/people').then(function(response) { | |
return response.json() | |
}.bind(this)); | |
console.log(this.state.people); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var baseURL = 'http://swapi.co/api'; | |
var service = { | |
get: function(url) { | |
return fetch(baseURL + url) | |
//returning a promise | |
//function callback that will promise us something | |
.then(function(response) { | |
return response.json(); |