Skip to content

Instantly share code, notes, and snippets.

View laere's full-sized avatar
🎯
Focusing

Zack laere

🎯
Focusing
  • Grand Rapids, MI
View GitHub Profile
filterMovies: function() {
var moviePosters = [];
for (var i; i <= 5; i++) {
if(apiData.rating >= 8) {
return moviePosters.push(apiData.Poster);
} else {
return;
}
}
},
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: []
var React = require('react');
var Search = React.createClass({
getInitialState: function() {
return {
value: '',
isExpanded: false
}
},
var React = require('react');
var Search = React.createClass({
getInitialState: function() {
return {
value: '',
isExpanded: false
}
},
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
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) {
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 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 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);
},
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();