Created
March 29, 2018 19:50
-
-
Save cmolenda/2eea7828b4edc349063f5329af7e7700 to your computer and use it in GitHub Desktop.
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 hasher from './hasher'; | |
import React, { Component } from 'react'; | |
// import Reflux from 'reflux'; | |
class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
raw: '' | |
} | |
} | |
setRaw(raw) { | |
this.setState({ raw }) | |
} | |
getHash() { | |
return hasher(this.state.raw); | |
} | |
shouldComponentRender() { return true } | |
render() { | |
const style = { | |
margin: '10px', | |
padding: '10px', | |
borderStyle: 'solid' | |
}; | |
return ( | |
<div style={{ display: 'flex' }}> | |
<div style={style}> | |
<p>input address and tab out</p> | |
<input onBlur={this.setRaw.bind(this)} /> | |
<div style={style}> | |
<h1>Response</h1> | |
<p>{this.getHash.bind(this)()}</p> | |
</div> | |
</div> | |
<div style={style} > | |
<h1>Response</h1> | |
<p>{this.getHash.bind(this)()}</p> | |
</div> | |
</div> | |
); | |
} | |
} | |
export default App; |
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
export default (address) => { | |
console.log('COSTLY FETCH'); | |
return(Math.floor(Math.random() * 10)); | |
} |
dfunaki
commented
Mar 29, 2018
•
hasher.js
export default (address) => {
console.log('COSTLY FETCH');
return(String(address) + String(Math.floor(Math.random() * 10)));
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment