mode switch
This commit is contained in:
parent
b0c27a160b
commit
f204abebe3
|
|
@ -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(){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue