Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dawsmith06 authored Jul 13, 2020
1 parent c4e8c95 commit b081fe9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const idle = (function(){
let options = {};
return {
start(opts) {
options.timeout = opts.timeout || 40;
options.inactive = opts.inactive || 5;
this.options.timeout = opts.timeout || 40;
this.options.inactive = opts.inactive || 5;
this.time = 0;
this.idle = "active";
this.setTimer();
Expand All @@ -13,11 +13,11 @@ const idle = (function(){
setTimer(){
this._timer = setInterval(() =>{
this.time++;
this.onTimeChange();
this.onTimerChange();
} , 60000);
},

onTimeChange(){
onTimerChange(){
if(this.time == this.options.timeout){
this.dispatchChannel("idle");
}
Expand Down Expand Up @@ -61,4 +61,4 @@ const idle = (function(){
};
}());

module.exports.idle = idle;
module.exports.idle = idle;

0 comments on commit b081fe9

Please sign in to comment.