componentDidMount() {
        this.getData().then(_ => {
            // Re-fetch every minute
            this.interval = setInterval(this.getData, 60000);
        });
    }
// Fetch data when the component is added
Fetch data when the component is added
Fetch data when the component is added
componentDidMount() {
        this.getData().then(_ => {
            this.interval = setInterval(this.getData, 60000);
        });
    }
componentDidMount ( ) { this . getData ( ) . then ( _ => { this . interval = setInterval ( this . getData , 60000 ) ; } ) ; }
Fetch data when the component is added
Fetch data when the component is added
// Re-fetch every minute