Skip to content

Instantly share code, notes, and snippets.

Created October 1, 2019 17:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save spion/1e47f243a6a83b3089f2fcf150c0f0fc to your computer and use it in GitHub Desktop.
@observer class Chart(props) {
@computed get data() { return getDataWithinRange(this.props.dateRange) }
@computed get dimensions() { return getDimensions() }
@computed get xScale() { return getXScale() }
@computed get yScale() { return getYScale() }
render() {
// use this.xScale, this.yScale etc. component will re-render automatically if any of those update.
return <svg className="Chart" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment