render() {
        this.reformatData()

        this.calculate()

        this.countdown.innerHTML = this.getDisplay()

        if (this.showMilliseconds) {
            let timer = setInterval((e) => {
                this.remainingMilliseconds -= 25
                this.calculate()
                this.countdown.innerHTML = this.getDisplay()
                if (this.isFinished()) {
                    this.dispatchEvent(this.event_finished)
                    clearInterval(timer)
                }
            }, 25)
        }
        else {
            let timer = setInterval((e) => {
                this.remainingSeconds -= 1
                this.calculate()
                this.countdown.innerHTML = this.getDisplay()
                if (this.isFinished()) {
                    this.dispatchEvent(this.event_finished)
                    clearInterval(timer)
                }
            }, 1000)
        }
    }
// Re-render the whole countdown
Re-render the whole countdown
Re - render the whole countdown
render() {
        this.reformatData()
        this.calculate()
        this.countdown.innerHTML = this.getDisplay()
        if (this.showMilliseconds) {
            let timer = setInterval((e) => {
                this.remainingMilliseconds -= 25
                this.calculate()
                this.countdown.innerHTML = this.getDisplay()
                if (this.isFinished()) {
                    this.dispatchEvent(this.event_finished)
                    clearInterval(timer)
                }
            }, 25)
        }
        else {
            let timer = setInterval((e) => {
                this.remainingSeconds -= 1
                this.calculate()
                this.countdown.innerHTML = this.getDisplay()
                if (this.isFinished()) {
                    this.dispatchEvent(this.event_finished)
                    clearInterval(timer)
                }
            }, 1000)
        }
    }
render ( ) { this . reformatData ( ) this . calculate ( ) this . countdown . innerHTML = this . getDisplay ( ) if ( this . showMilliseconds ) { let timer = setInterval ( ( e ) => { this . remainingMilliseconds -= 25 this . calculate ( ) this . countdown . innerHTML = this . getDisplay ( ) if ( this . isFinished ( ) ) { this . dispatchEvent ( this . event_finished ) clearInterval ( timer ) } } , 25 ) } else { let timer = setInterval ( ( e ) => { this . remainingSeconds -= 1 this . calculate ( ) this . countdown . innerHTML = this . getDisplay ( ) if ( this . isFinished ( ) ) { this . dispatchEvent ( this . event_finished ) clearInterval ( timer ) } } , 1000 ) } }
Re-render the whole countdown
Re - render the whole countdown