Skip to content

Commit 0f463c9

Browse files
committed
add higher and configurable reconnect time
1 parent 5a016f3 commit 0f463c9

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.changeset/plain-eagles-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/devtools-event-client': patch
3+
---
4+
5+
increase minimum reconnection time and allow it to be configurable on event bus client

packages/event-bus-client/src/plugin.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ export class EventClient<
6464
pluginId,
6565
debug = false,
6666
enabled = true,
67+
reconnectEveryMs = 1000,
6768
}: {
6869
pluginId: TPluginId
6970
debug?: boolean
70-
71+
reconnectEveryMs?: number
7172
enabled?: boolean
7273
}) {
7374
this.#pluginId = pluginId
@@ -78,7 +79,7 @@ export class EventClient<
7879
this.#queuedEvents = []
7980
this.#connected = false
8081
this.#connectIntervalId = null
81-
this.#connectEveryMs = 500
82+
this.#connectEveryMs = reconnectEveryMs
8283
}
8384

8485
private startConnectLoop() {

0 commit comments

Comments
 (0)