move logic out of reducer into middleware

This commit is contained in:
Colin Megill
2017-12-22 19:30:32 -08:00
parent 78dbe1913a
commit eb1caa9c68
3 changed files with 20 additions and 10 deletions
+8 -3
View File
@@ -18,8 +18,13 @@ class Expression extends React.Component {
};
}
handleClick() {
handleClick(gene) {
return () => {
this.props.dispatch({
type: "color by expression",
gene: gene,
});
}
}
render () {
if (!this.props.expression) return null
@@ -31,7 +36,7 @@ class Expression extends React.Component {
return (
<button
key={gene}
onClick={this.handleClick.bind(this)}
onClick={this.handleClick(gene).bind(this)}
style={{marginRight: 10}}>
{gene}
</button>