Skip to content

Commit

Permalink
remove implicit type
Browse files Browse the repository at this point in the history
  • Loading branch information
R4nt4npl4n committed Nov 29, 2023
1 parent 25da1d9 commit 91b72ad
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/TestD2CMessageSubscriber.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC, useState } from 'react';
import { useD2CMessages } from './library/useD2CMessages';
import { useD2CMessages } from './library';

type Props = {
deviceId: string;
Expand Down
2 changes: 1 addition & 1 deletion src/TestInvokeDirectMethod.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC, useCallback, useState } from 'react';
import { useDirectMethod } from './library/useDirectMethod';
import { useDirectMethod } from './library';

type Props = {
deviceId: string;
Expand Down
2 changes: 1 addition & 1 deletion src/TestMultiConnectionState.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC } from 'react';
import { useMultiConnectionState } from './library/useMultiConnectionState';
import { useMultiConnectionState } from './library';

type Props = {
deviceIds: string[];
Expand Down
2 changes: 1 addition & 1 deletion src/TestPatchDesiredProperties.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/TestSingleSubscriber.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC, useState } from 'react';
import { useTelemetry } from './library/useTelemetry';
import { useTelemetry } from './library';

type Props = {
deviceId: string;
Expand Down
4 changes: 1 addition & 3 deletions src/TestSubscriber.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
12 changes: 5 additions & 7 deletions src/library/useDirectMethod.ts
Original file line number Diff line number Diff line change
@@ -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<string, unknown>,
Expand All @@ -26,7 +26,7 @@ export const useDirectMethod = (
onGrantErrorRef.current = onGrantError;
}, [onGrantError]);

const directMethod = useCallback(
return useCallback(
async (
payload,
responseTimeoutInSeconds,
Expand All @@ -53,6 +53,4 @@ export const useDirectMethod = (
},
[ux4iot, sessionId, deviceId, directMethodName]
);

return directMethod;
};

0 comments on commit 91b72ad

Please sign in to comment.