move async out of app

This commit is contained in:
Colin Megill
2017-10-12 19:32:09 -07:00
parent 0ba5386a34
commit 381e6fe927
+4 -36
View File
@@ -10,22 +10,20 @@ import Continuous from "./continuous/continuous";
import Joy from "./joy/joy"; import Joy from "./joy/joy";
import Graph from "./graph/graph"; import Graph from "./graph/graph";
import * as globals from "../globals"; import * as globals from "../globals";
import * as actions from "../actions";
import SectionHeader from "./framework/sectionHeader"; import SectionHeader from "./framework/sectionHeader";
@connect((state) => { @connect((state) => {
return { return {
foo123: state
} }
}) })
class Home extends React.Component { class Home extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
expressions: null,
vertices: null,
coloring: null,
metadata: null,
}; };
} }
_onURLChanged () { _onURLChanged () {
@@ -37,33 +35,8 @@ class Home extends React.Component {
window.addEventListener('popstate', this._onURLChanged); window.addEventListener('popstate', this._onURLChanged);
this._onURLChanged(); this._onURLChanged();
/* fire an initialize action */ this.props.dispatch(actions.requestCells())
const expressions = fetch(`${globals.API.prefix}${globals.API.version}expression`, {
method: "post",
headers: new Headers({
'Content-Type': 'application/json'
}),
body: JSON.stringify({
// "celllist": ["1001000173.G8", "1001000173.D4"],
"genelist": ["1/2-SBSRNA4", "A1BG", "A1BG-AS1", "A1CF", "A2LD1", "A2M", "A2ML1", "A2MP1", "A4GALT"]
})
})
// const expressions = fetch(`${prefix}${version}${expression}`)
.then((res) => res.json())
.then((data) => { this.setState({expressions: data}) })
const initialize = fetch(`${globals.API.prefix}${globals.API.version}initialize`)
.then((res) => res.json())
.then((data) => { this.setState({initialize: data}) })
const graph = fetch(`${globals.API.prefix}${globals.API.version}graph`)
.then((res) => res.json())
.then((data) => { this.setState({vertices: data}) })
}
componentWillUpdate() {
this.props.dispatch({type: "initialize app", data: "kitty! :D"})
} }
createExpressionsCountsMap () { createExpressionsCountsMap () {
@@ -119,8 +92,3 @@ class Home extends React.Component {
}; };
export default Home; export default Home;
// <Categorical title={"Sample type"} category={types}/>
// <Categorical title={"Selection"} category={selection}/>
// <Categorical title={"Location"} category={location}/>
// <Categorical title={"Sample name"} category={names}/>