We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c09fdfb commit 39481b9Copy full SHA for 39481b9
src/bridge.js
@@ -27,18 +27,20 @@ export default class Bridge extends EventEmitter {
27
28
send (event, payload) {
29
if (this._time === null) {
30
+ this.wall.send([{ event, payload }])
31
this._time = Date.now()
- }
32
- this._queue.push({
33
- event,
34
- payload
35
- })
36
-
37
- const now = Date.now()
38
- if (now - this._time > BATCH_DURATION) {
39
- this._flush()
40
} else {
41
- this._timer = setTimeout(() => this._flush(), BATCH_DURATION)
+ this._queue.push({
+ event,
+ payload
+ })
+
+ const now = Date.now()
+ if (now - this._time > BATCH_DURATION) {
+ this._flush()
+ } else {
42
+ this._timer = setTimeout(() => this._flush(), BATCH_DURATION)
43
+ }
44
}
45
46
0 commit comments