This file contains 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
let canvas = ()=>( <div> | |
<div class="vertical-center project-text"> | |
<h2 class="project-text__title">Bounce Circle </h2> | |
<div class="hero-hr"></div> | |
<h3 class="project-text__sub fancy-text">Aug 24, 2017</h3> | |
</div> | |
<canvas></canvas> | |
</div> | |
); |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<!-- Custom styles for this template --> | |
<!--<link href="./assets/css/usemygear-jumbotron.css" rel="stylesheet">--> |
This file contains 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
import React, { Component } from 'react'; | |
import { Link, withRouter } from 'react-router-dom'; | |
import '../../build/assets/css/style.css'; | |
const HandleLogin = withRouter(({ history }) => ( | |
<button onClick={() => { | |
history.push('/') | |
}}>Sign out</button> | |
This file contains 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
function sendData(data) { | |
var XHR = new XMLHttpRequest(); | |
var urlEncodedData = ""; var urlEncodedDataPairs = []; var name; | |
for(name in data) { | |
urlEncodedDataPairs.push(encodeURIComponent(name) + '=' + encodeURIComponent(data[name])); | |
} | |
urlEncodedData = urlEncodedDataPairs.join('&').replace(/%20/g, '+'); | |
XHR.addEventListener('load', function(event) { | |
console.log('Yeah! Data sent and response loaded.'); |
This file contains 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
// webpack | |
presets: ['stage-0', 'es2015', 'react'] | |
// saga fetch | |
const { loginEmail, loginPwd } = request.payload; | |
let postLoginSubmitOptions = { | |
method: "POST", | |
headers: new Headers({ | |
'Accept': 'application/json', |
This file contains 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
// sagas.js | |
function * fetchIncrement () { | |
const response = yield call(fetch, "http://haha.com/fetch_1") | |
const data = yield call([response, response.json]) | |
const number = parseInt(data) | |
console.log(number) | |
return number | |
} |
This file contains 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
// sagas.js | |
function* fetchIncrement(){ | |
return fetch(`http://haha.com/fetch_1`) | |
.then(res=>res.json()) | |
.then(data=>{ | |
console.log(parseInt(data)); // returns string "1" and logs 1 as expected | |
return parseInt(data); | |
}).catch(err=>console.log(err)) | |
} |
NewerOlder