From 91b72ad8bc03ed2f8fa1394702600bebb1cc343c Mon Sep 17 00:00:00 2001 From: Tarek Hamed Date: Wed, 29 Nov 2023 11:50:19 +0100 Subject: [PATCH] remove implicit type --- package-lock.json | 4 ++-- src/App.tsx | 2 +- src/TestD2CMessageSubscriber.tsx | 2 +- src/TestInvokeDirectMethod.tsx | 2 +- src/TestMultiConnectionState.tsx | 2 +- src/TestPatchDesiredProperties.tsx | 2 +- src/TestSingleSubscriber.tsx | 2 +- src/TestSubscriber.tsx | 4 +--- src/library/useDirectMethod.ts | 12 +++++------- 9 files changed, 14 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4fe7b93..8b993c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ux4iot-react", - "version": "4.1.1", + "version": "4.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ux4iot-react", - "version": "4.1.1", + "version": "4.1.3", "dependencies": { "axios": "^1.6.2", "azure-iothub": "1.14.1", diff --git a/src/App.tsx b/src/App.tsx index 51f5f30..d73a2cd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { Ux4iotContextProvider } from './library/Ux4iotContext'; +import { Ux4iotContextProvider } from './library'; import { TestInvokeDirectMethod } from './TestInvokeDirectMethod'; import { TestPatchDesiredProperties } from './TestPatchDesiredProperties'; import { TestSingleSubscriber } from './TestSingleSubscriber'; diff --git a/src/TestD2CMessageSubscriber.tsx b/src/TestD2CMessageSubscriber.tsx index fed70c2..9428eeb 100644 --- a/src/TestD2CMessageSubscriber.tsx +++ b/src/TestD2CMessageSubscriber.tsx @@ -1,5 +1,5 @@ import { FC, useState } from 'react'; -import { useD2CMessages } from './library/useD2CMessages'; +import { useD2CMessages } from './library'; type Props = { deviceId: string; diff --git a/src/TestInvokeDirectMethod.tsx b/src/TestInvokeDirectMethod.tsx index 629267f..6507d26 100644 --- a/src/TestInvokeDirectMethod.tsx +++ b/src/TestInvokeDirectMethod.tsx @@ -1,5 +1,5 @@ import { FC, useCallback, useState } from 'react'; -import { useDirectMethod } from './library/useDirectMethod'; +import { useDirectMethod } from './library'; type Props = { deviceId: string; diff --git a/src/TestMultiConnectionState.tsx b/src/TestMultiConnectionState.tsx index 728c188..02dc138 100644 --- a/src/TestMultiConnectionState.tsx +++ b/src/TestMultiConnectionState.tsx @@ -1,5 +1,5 @@ import { FC } from 'react'; -import { useMultiConnectionState } from './library/useMultiConnectionState'; +import { useMultiConnectionState } from './library'; type Props = { deviceIds: string[]; diff --git a/src/TestPatchDesiredProperties.tsx b/src/TestPatchDesiredProperties.tsx index d877a9b..ec67c7e 100644 --- a/src/TestPatchDesiredProperties.tsx +++ b/src/TestPatchDesiredProperties.tsx @@ -1,7 +1,7 @@ import axios from 'axios'; import { FC, useCallback, useState } from 'react'; import { IoTHubResponse } from './library'; -import { usePatchDesiredProperties } from './library/usePatchDesiredProperties'; +import { usePatchDesiredProperties } from './library'; type Props = { deviceId: string; diff --git a/src/TestSingleSubscriber.tsx b/src/TestSingleSubscriber.tsx index 65bb8ee..f682569 100644 --- a/src/TestSingleSubscriber.tsx +++ b/src/TestSingleSubscriber.tsx @@ -1,5 +1,5 @@ import { FC, useState } from 'react'; -import { useTelemetry } from './library/useTelemetry'; +import { useTelemetry } from './library'; type Props = { deviceId: string; diff --git a/src/TestSubscriber.tsx b/src/TestSubscriber.tsx index 0bbcd0e..2159628 100644 --- a/src/TestSubscriber.tsx +++ b/src/TestSubscriber.tsx @@ -1,7 +1,5 @@ import { FC, useState } from 'react'; -import { useMultiTelemetry } from './library'; -import { useConnectionState } from './library/useConnectionState'; -import { useDeviceTwin } from './library/useDeviceTwin'; +import { useMultiTelemetry, useConnectionState, useDeviceTwin } from './library'; type Props = { deviceId: string; diff --git a/src/library/useDirectMethod.ts b/src/library/useDirectMethod.ts index 5f77a2e..02a4f17 100644 --- a/src/library/useDirectMethod.ts +++ b/src/library/useDirectMethod.ts @@ -1,7 +1,7 @@ -import { useCallback, useContext, useEffect, useRef } from 'react'; -import { GrantErrorCallback } from './base/types'; -import { DirectMethodGrantRequest, IoTHubResponse } from './base/ux4iot-shared'; -import { Ux4iotContext } from './Ux4iotContext'; +import {useCallback, useContext, useEffect, useRef} from 'react'; +import {GrantErrorCallback} from './base/types'; +import {DirectMethodGrantRequest, IoTHubResponse} from './base/ux4iot-shared'; +import {Ux4iotContext} from './Ux4iotContext'; type UseDirectMethodOutput = ( payload: Record, @@ -26,7 +26,7 @@ export const useDirectMethod = ( onGrantErrorRef.current = onGrantError; }, [onGrantError]); - const directMethod = useCallback( + return useCallback( async ( payload, responseTimeoutInSeconds, @@ -53,6 +53,4 @@ export const useDirectMethod = ( }, [ux4iot, sessionId, deviceId, directMethodName] ); - - return directMethod; };