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

Introduce Hooks #199

Merged
merged 29 commits into from
Sep 23, 2024
Merged

Introduce Hooks #199

merged 29 commits into from
Sep 23, 2024

Conversation

lucemans
Copy link
Member

@lucemans lucemans commented Sep 4, 2024

This PR introduces the basic foundations for react hooks within ensjs
They are packaged under @ensdomains/ensjs-react (credit #85)

Wagmi already comes packed with the powerful:

  • useEnsAddress
  • useEnsAvatar
  • useEnsName
  • useEnsResolver
  • useEnsText

However @ensdomains/ensjs-react introduces:

  • useEnsAvailable - checks availability (uses getAvailable)
  • useEnsExpiry - returns expiry of a name (uses getExpiry)
  • useEnsResolverInterfaces - check supportsInterface on resolver (uses getSupportedInterfaces)
  • useNamesForAddress - lists names from subgraph (uses getNamesForAddress)
  • useDecodedName - decodes name using subgraph (uses getDecodedName)
  • useEnsRecordsWrite - writes records to a name (uses setRecords) (wip)
  • useEnsCredentials - returns credentials from a name (uses getTextRecord) (lite)

This PR relies on peer-dependencies

  • @tanstack/react-query (which wagmi does too)

packages/ensjs/package.json Outdated Show resolved Hide resolved
packages/ensjs/package.json Outdated Show resolved Hide resolved
packages/ensjs/package.json Outdated Show resolved Hide resolved
packages/ensjs/package.json Outdated Show resolved Hide resolved
packages/react/tsconfig.build.json Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Sep 23, 2024

@lucemans lucemans merged commit 1c2aa83 into main Sep 23, 2024
2 of 3 checks passed
@lucemans lucemans deleted the feat/hooks branch September 23, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants