From 94ed9b6998bc3c5f912b34dc04015f4dc2d6a210 Mon Sep 17 00:00:00 2001 From: Niels Peschel <52583415+NielsJPeschel@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:59:35 -0400 Subject: [PATCH] correct imports in README docs (#22) --- hooks/useCommonContext/README.md | 2 +- hooks/useFocus/README.md | 2 +- hooks/useLoadData/README.md | 2 +- hooks/useOptionalDependency/README.md | 4 ++-- hooks/useRetry/README.md | 2 +- hooks/useServiceEffect/README.md | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hooks/useCommonContext/README.md b/hooks/useCommonContext/README.md index 9af7a5c..698b145 100644 --- a/hooks/useCommonContext/README.md +++ b/hooks/useCommonContext/README.md @@ -8,7 +8,7 @@ A React hook that allows connecting to several potential active react contexts. ```Typescript import React from 'react'; -import {useCommonContext} from 'react-hooks'; +import {useCommonContext} from '@optum/react-hooks'; import {useContextA} from 'some-context-provider-a'; import {useContextB} from 'some-context-provider-b'; diff --git a/hooks/useFocus/README.md b/hooks/useFocus/README.md index 60fc410..8fc394c 100644 --- a/hooks/useFocus/README.md +++ b/hooks/useFocus/README.md @@ -8,7 +8,7 @@ A React hook that simplifies focus management. ```Typescript import React from 'react'; -import {useFocus} from 'react-hooks'; +import {useFocus} from '@optum/react-hooks'; export const MyComponent = ({ diff --git a/hooks/useLoadData/README.md b/hooks/useLoadData/README.md index 7a775af..a5d9e20 100644 --- a/hooks/useLoadData/README.md +++ b/hooks/useLoadData/README.md @@ -7,7 +7,7 @@ A React hook that simplifies complex data loading requirements. The most simple usage is to pass a single argument, which should be an asynchronous function. This function will get executed immediately upon component initialization: ```TypeScript -import {useLoadData} from 'react-hooks'; +import {useLoadData} from '@optum/react-hooks'; export const DataComponent: React.FC = () => { const {isError, isInProgress, result} = useLoadData(async () => fetch(...)); diff --git a/hooks/useOptionalDependency/README.md b/hooks/useOptionalDependency/README.md index 6bc34ba..e52d25f 100644 --- a/hooks/useOptionalDependency/README.md +++ b/hooks/useOptionalDependency/README.md @@ -3,11 +3,11 @@ A React hook that safely optionalizes retry responses. ## Usage -`useOptionalDependency` is designed to be used in tandem with [useLoadData](../useLoadData/). This hook will safely optionalize a [retry response objects](../../RetryResponse.ts), meaning an optional dependency that returns type `T` will be typed as `T | null` when passed into `fetchData`, and will always be treated as _null_ by `useLoadData` if the dependency errors. The advantage here being that `useLoadData` will still wait upon the optional dependency to resolve (successfully or unsucessfully), and more significantly, does not hold up a dependency chain while still exposing an error. +`useOptionalDependency` is designed to be used in tandem with [useLoadData](../useLoadData/). This hook will safely optionalize a [retry response objects](https://github.com/Optum/react-hooks/blob/main/types/RetryResponse.ts), meaning an optional dependency that returns type `T` will be typed as `T | null` when passed into `fetchData`, and will always be treated as _null_ by `useLoadData` if the dependency errors. The advantage here being that `useLoadData` will still wait upon the optional dependency to resolve (successfully or unsucessfully), and more significantly, does not hold up a dependency chain while still exposing an error. ```Typescript import React from 'react'; -import {useLoadData} from '@Optum/react-hooks'; +import {useLoadData} from '@optum/react-hooks'; export const MyComponent = (props) => { const loadedUserProfile = useLoadData(fetchUserProfile); // loadedUserProfile will be of type RetryResponse diff --git a/hooks/useRetry/README.md b/hooks/useRetry/README.md index 6e5bd2d..776e910 100644 --- a/hooks/useRetry/README.md +++ b/hooks/useRetry/README.md @@ -3,7 +3,7 @@ A React hook that simplifies retrying failed service calls. ## Usage -`useRetry` exposes a wrapped version of [useLoadData](../useLoadData/) that retries any and all errored [retry response objects](../../types/RetryResponse), and only those responses created, from that exposed version of _useLoadData_. +`useRetry` exposes a wrapped version of [useLoadData](../useLoadData/) that retries any and all errored [retry response objects](https://github.com/Optum/react-hooks/blob/main/types/RetryResponse.ts), and only those responses created, from that exposed version of _useLoadData_. diff --git a/hooks/useServiceEffect/README.md b/hooks/useServiceEffect/README.md index f996765..437f171 100644 --- a/hooks/useServiceEffect/README.md +++ b/hooks/useServiceEffect/README.md @@ -22,7 +22,7 @@ and our component looks something like this: ```Typescript import React from 'react'; -import {useServiceEffect} from 'react-hooks'; +import {useServiceEffect} from '@optum/react-hooks'; export const MyComponent = ({