JSFiddle - React, Tailwind, and code Playground

by davidcl64

JavaScript

var theActivityTimer = {
    timer: null,          
    active: false,       

    refresh: function () {
        this.timer = setTimeout(function(){
          console.log(this);
          this.timeOut.call(this)
        }, 5000);
    },

    timedOut: function(){
        alert("timedout " + this.active);
    }
}

theActivityTimer.refresh();