Skip to content

Commit

Permalink
feat: hook for getting the current signer (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
tien authored Aug 21, 2024
1 parent d9db0c9 commit 510dd4b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-carrots-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@reactive-dot/react": minor
---

Added hook for getting the current signer.
11 changes: 11 additions & 0 deletions packages/react/src/hooks/use-signer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { SignerContext } from "../contexts/signer.js";
import { useContext } from "react";

/**
* Hook for getting the current signer.
*
* @returns The current signer
*/
export function useSigner() {
return useContext(SignerContext);
}
1 change: 1 addition & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export {
useLazyLoadQueryWithRefresh,
useQueryRefresher,
} from "./hooks/use-query.js";
export { useSigner } from "./hooks/use-signer.js";
export { useTypedApi } from "./hooks/use-typed-api.js";
export { useWalletConnector } from "./hooks/use-wallet-connector.js";
export { useWalletDisconnector } from "./hooks/use-wallet-disconnector.js";
Expand Down

0 comments on commit 510dd4b

Please sign in to comment.