import React from "react"; import Store from "./interface/Store"; export default class SeriesStats extends React.Component { constructor() { super() this.state = { stats: Store.getSeriesStats() } this.getStats = this.getStats.bind(this) this.color = ['#d0d0d0', '#ff3333', '#32cd32', '#4F94CD'] } componentDidMount() { Store.on("serstats", this.getStats) } componentWillUnmount() { Store.removeListener("serstats", this.getStats) } getStats() { this.setState({ stats: Store.getSeriesStats() }) } render() { return (
played
{this.state.stats.plyd}
{this.state.stats.c1}
{this.state.stats.c2}
{this.state.stats.c3}
); } }