Skip to content

Instantly share code, notes, and snippets.

@pbeshai
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbeshai/a581082637d74c6ac694 to your computer and use it in GitHub Desktop.
Save pbeshai/a581082637d74c6ac694 to your computer and use it in GitHub Desktop.
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;
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