Last active
August 29, 2015 14:20
-
-
Save pbeshai/a581082637d74c6ac694 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 Reflux from 'reflux'; | |
const ChartActions = Reflux.createActions([ | |
/** | |
* Sets a point to be higlighted in charts | |
* @param point {Object} - the data point to be highlighted | |
*/ | |
'highlight' | |
]); | |
export default ChartActions; |
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 Reflux from 'reflux'; | |
import ChartActions from '../actions/ChartActions'; | |
const ChartStore = Reflux.createStore({ | |
listenables: ChartActions, | |
// store the newly highlighted point and broadcast the change | |
onHighlight(point) { | |
this.highlight = point; | |
this.update(); | |
}, | |
// broadcast the currently highlighted point | |
update() { | |
this.trigger({ | |
highlight: this.highlight | |
}); | |
} | |
}); | |
export default ChartStore; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment