Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia committed Mar 6, 2024
1 parent 4907806 commit e6fa671
Showing 1 changed file with 41 additions and 47 deletions.
88 changes: 41 additions & 47 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,61 @@

### Minor Changes

- 4090f4f: - **feat**: Replace internal `useOnchainActionWithCache` with `tanstack/react-query`. This affects `useName` and `useAvatar` hooks. The return type and the input parameters also changed for these 2 hooks.
- **feat**: Replace internal `useOnchainActionWithCache` with `tanstack/react-query`. This affects `useName` and `useAvatar` hooks. The return type and the input parameters also changed for these 2 hooks. 4090f4f

BREAKING CHANGES

The input parameters as well as return types of `useName` and `useAvatar` hooks have changed. The return type of `useName` and `useAvatar` hooks changed.

### `useName`
BREAKING CHANGES

Before
The input parameters as well as return types of `useName` and `useAvatar` hooks have changed. The return type of `useName` and `useAvatar` hooks changed.

```tsx
import { useName } from "@coinbase/onchainkit/identity";
### `useName`

const { ensName, isLoading } = useName("0x1234");
```
Before

After
```tsx
import { useName } from '@coinbase/onchainkit/identity';

```tsx
import { useName } from "@coinbase/onchainkit/identity";
const { ensName, isLoading } = useName('0x1234');
```

// Return type signature is following @tanstack/react-query useQuery hook signature
const {
data: name,
isLoading,
isError,
error,
status,
} = useName(
{ address: "0x1234" },
{ enabled: true, cacheTime: 1000 * 60 * 60 * 24 },
);
```
After

### `useAvatar`
```tsx
import { useName } from '@coinbase/onchainkit/identity';

// Return type signature is following @tanstack/react-query useQuery hook signature
const {
data: name,
isLoading,
isError,
error,
status,
} = useName({ address: '0x1234' }, { enabled: true, cacheTime: 1000 * 60 * 60 * 24 });
```

Before
### `useAvatar`

```tsx
import { useAvatar } from "@coinbase/onchainkit/identity";
Before

const { ensAvatar, isLoading } = useAvatar("vitalik.eth");
```
```tsx
import { useAvatar } from '@coinbase/onchainkit/identity';

After
const { ensAvatar, isLoading } = useAvatar('vitalik.eth');
```

```tsx
import { useAvatar } from "@coinbase/onchainkit/identity";
After

// Return type signature is following @tanstack/react-query useQuery hook signature
const {
data: avatar,
isLoading,
isError,
error,
status,
} = useAvatar(
{ ensName: "vitalik.eth" },
{ enabled: true, cacheTime: 1000 * 60 * 60 * 24 },
);
```
```tsx
import { useAvatar } from '@coinbase/onchainkit/identity';

// Return type signature is following @tanstack/react-query useQuery hook signature
const {
data: avatar,
isLoading,
isError,
error,
status,
} = useAvatar({ ensName: 'vitalik.eth' }, { enabled: true, cacheTime: 1000 * 60 * 60 * 24 });
```

## 0.9.12

Expand Down

0 comments on commit e6fa671

Please sign in to comment.