mode switch

This commit is contained in:
jake downs 2024-02-08 22:08:00 -05:00
parent b0c27a160b
commit f204abebe3
1 changed files with 4 additions and 3 deletions

View File

@ -467,13 +467,14 @@ export default class Glasses extends EventTarget {
class RepeatingDeviceReportPoll { class RepeatingDeviceReportPoll {
timer = null; timer = null;
constructor(opts = {}){ constructor(opts){
opts = opts || {}; opts = opts || {};
opts = { opts = {
interval: 100, interval: 100,
callback: ()=>{}, // this is the function that will be called callback: ()=>{}, // this is the function that will be called
...opts ...opts
} }
this.opts = opts;
} }
@ -483,9 +484,9 @@ class RepeatingDeviceReportPoll {
if(this.ended){ if(this.ended){
clearInterval(this.timer) clearInterval(this.timer)
}else{ }else{
opts.callback() this.opts.callback()
} }
},opts.interval) },this.opts.interval)
} }
end(){ end(){