I have the following code that sets the interval at which another function (a 1 minute timer) is executed. I'd like to be able to change this interval elsewhere to control play, pause and reset buttons. I was thinking of starting the program with an interval of 0 so the method is not yet called, changing to 1000 when play is pressed, and then toggling between 0 and 1000 when a pause button is pressed once and then pressed again. Is there a straight forward way to do this?
componentDidMount() {
setInterval(this.countdownMinute, 1000);
}