Skip to content

Instantly share code, notes, and snippets.

@spion
Created October 1, 2019 17:39
Show Gist options
  • Save spion/1e47f243a6a83b3089f2fcf150c0f0fc to your computer and use it in GitHub Desktop.
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