🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-signalr

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-signalr - npm Package Compare versions

Comparing version

to
0.2.22

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [0.2.22](https://github.com/hosseinmd/react-signalr/compare/v0.2.21...v0.2.22) (2024-05-26)
### Features
* add retyrDelay to automaticReconnect ([93b43b1](https://github.com/hosseinmd/react-signalr/commit/93b43b1fab2860da85702ed2723d8ec113561015))
### [0.2.21](https://github.com/hosseinmd/react-signalr/compare/v0.2.20...v0.2.21) (2024-05-26)

@@ -7,0 +14,0 @@

7

lib/signalr/provider/types.d.ts

@@ -14,4 +14,9 @@ import { HubConnection, IHttpConnectionOptions } from "@microsoft/signalr";

onReconnect?: (connection: HubConnection) => void;
automaticReconnect?: boolean;
/** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.
*
* `number[]` retryDelays An array containing the delays in milliseconds before trying each reconnect attempt.
* The length of the array represents how many failed reconnect attempts it takes before the client will stop attempting to reconnect.
*/
automaticReconnect?: boolean | number[];
}
//# sourceMappingURL=types.d.ts.map

2

lib/signalr/utils.d.ts
import { HubConnection, IHttpConnectionOptions } from "@microsoft/signalr";
declare function isConnectionConnecting(connection: HubConnection): boolean;
declare function createConnection(url: string, transportType: IHttpConnectionOptions, automaticReconnect?: boolean): HubConnection;
declare function createConnection(url: string, transportType: IHttpConnectionOptions, automaticReconnect?: boolean | number[]): HubConnection;
export { isConnectionConnecting, createConnection };
//# sourceMappingURL=utils.d.ts.map

@@ -14,3 +14,9 @@ "use strict";

if (automaticReconnect) {
connectionBuilder = connectionBuilder.withAutomaticReconnect();
if (Array.isArray(automaticReconnect)) {
connectionBuilder =
connectionBuilder.withAutomaticReconnect(automaticReconnect);
}
else {
connectionBuilder = connectionBuilder.withAutomaticReconnect();
}
}

@@ -17,0 +23,0 @@ if (transportType.logger) {

{
"name": "react-signalr",
"version": "0.2.21",
"version": "0.2.22",
"description": "React-signalr is a tools for using signalr web socket in react/react-native apps",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -15,3 +15,8 @@ import { HubConnection, IHttpConnectionOptions } from "@microsoft/signalr";

onReconnect?: (connection: HubConnection) => void;
automaticReconnect?: boolean;
/** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.
*
* `number[]` retryDelays An array containing the delays in milliseconds before trying each reconnect attempt.
* The length of the array represents how many failed reconnect attempts it takes before the client will stop attempting to reconnect.
*/
automaticReconnect?: boolean | number[];
}

@@ -19,3 +19,3 @@ import {

transportType: IHttpConnectionOptions,
automaticReconnect = true,
automaticReconnect: boolean | number[] = true,
) {

@@ -28,3 +28,8 @@ let connectionBuilder = new HubConnectionBuilder().withUrl(

if (automaticReconnect) {
connectionBuilder = connectionBuilder.withAutomaticReconnect();
if (Array.isArray(automaticReconnect)) {
connectionBuilder =
connectionBuilder.withAutomaticReconnect(automaticReconnect);
} else {
connectionBuilder = connectionBuilder.withAutomaticReconnect();
}
}

@@ -31,0 +36,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet