Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct imports in README docs #22

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hooks/useCommonContext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion hooks/useFocus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ({
Expand Down
2 changes: 1 addition & 1 deletion hooks/useLoadData/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(...));
Expand Down
4 changes: 2 additions & 2 deletions hooks/useOptionalDependency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Profile>
Expand Down
2 changes: 1 addition & 1 deletion hooks/useRetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_.



Expand Down
2 changes: 1 addition & 1 deletion hooks/useServiceEffect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ({
Expand Down
Loading