websocket-front
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "websocket-front", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "WebSocket client for browser with reconnect and heartbeat", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.esm.js", |
@@ -85,12 +85,12 @@ # websocket-front | ||
| 名称 | 类型 | 描述 | 默认值 | | ||
| ---------------- | -------- | -------------------------------- | -------- | | ||
| isReconnect | boolean | 是否需要自动重连 | true | | ||
| reconnectTimeout | number | 自动重连间隔时间 | 300ms | | ||
| reconnectRepeat | number | 尝试自动重连的次数 | Infinity | | ||
| isHeartbeat | boolean | 是否支持心跳检测 | 是 | | ||
| pingMsg | string | 心跳检测发送给后端的消息 | 'ping' | | ||
| pingTimeout | number | 发送心跳检测消息的延迟时间 | 30s | | ||
| pongTimeout | number | 多长时间没有收到返回的心跳就重启 | 300ms | | ||
| protocols | string[] | 指定子协议 | [] | | ||
| 名称 | 类型 | 描述 | 默认值 | | ||
| ---------------- | -------- | -------------------------------- | ------ | | ||
| isReconnect | boolean | 是否需要自动重连 | true | | ||
| reconnectTimeout | number | 自动重连间隔时间 | 300ms | | ||
| reconnectRepeat | number | 尝试自动重连的次数 | 3 | | ||
| isHeartbeat | boolean | 是否支持心跳检测 | 是 | | ||
| pingMsg | string | 心跳检测发送给后端的消息 | 'ping' | | ||
| pingTimeout | number | 发送心跳检测消息的延迟时间 | 30s | | ||
| pongTimeout | number | 多长时间没有收到返回的心跳就重启 | 300ms | | ||
| protocols | string[] | 指定子协议 | [] | | ||
@@ -97,0 +97,0 @@ ### 事件 |
@@ -57,3 +57,3 @@ interface EventParams { | ||
reconnectTimeout: options?.reconnectTimeout ?? 300, // 重连的时间间隔,默认300毫秒 | ||
reconnectRepeat: options?.reconnectRepeat ?? Infinity, | ||
reconnectRepeat: options?.reconnectRepeat ?? 3, // 重连次数,默认3,如果是Infinity 则为无数次 | ||
isHeartbeat: options?.isHeartbeat ?? true, | ||
@@ -60,0 +60,0 @@ pingMsg: options?.pingMsg ?? "ping", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24753