From ca47785d413437eb4001ab10ad6d6c468ae25ccb Mon Sep 17 00:00:00 2001 From: androidappteam Date: Mon, 4 Sep 2023 23:16:30 +0530 Subject: [PATCH] comments added | version updates --- package.json | 2 +- src/client.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ae8b0c8..6d3609b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@krishnafkh/react-native-grpc", - "version": "1.0.5", + "version": "1.0.6", "description": "gRPC for react-native", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/src/client.ts b/src/client.ts index de20df9..2acb26d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -196,6 +196,9 @@ export class GrpcClient { Grpc.setResponseSizeLimit(limitInBytes); } + /** + * initiating the grpc channel from JS layer + * */ initGrpcChannel() { Grpc.initGrpcChannel(); } @@ -208,20 +211,35 @@ export class GrpcClient { Grpc.setKeepAlive(enable, keepAliveTime, keepAliveTimeOut); } + /** + * only applicable for android + * @param message -> debug message + * */ resetConnection(message: string): void { if (!this.isAndroid()) return; Grpc.resetConnection(message); } + + /** + * only applicable for android + * @param enable -> show debug log in ui + * */ setUiLogEnabled(enable: boolean): void { if (!this.isAndroid()) return; Grpc.setUiLogEnabled(enable); } + /** + * only applicable for android , to reset connection based on manage-channel state + * */ onConnectionStateChange(): void { if (!this.isAndroid()) return; Grpc.onConnectionStateChange(); } + /** + * only applicable for android , to set manage-channel to idle state + * */ enterIdle(): void { if (!this.isAndroid()) return; Grpc.enterIdle();