sdk: only send events if we have any

This commit is contained in:
Carl-Gerhard Lindesvärd
2023-11-01 20:49:31 +01:00
parent f7ccafbda0
commit bbbc16be25

View File

@@ -111,10 +111,13 @@ class Batcher<T extends any> {
if(this.timer) { if(this.timer) {
clearTimeout(this.timer) clearTimeout(this.timer)
} }
if(this.queue.length > 0) {
this.callback(this.queue) this.callback(this.queue)
this.queue = [] this.queue = []
} }
} }
}
export class Mixan { export class Mixan {
private fetch: Fetcher private fetch: Fetcher