wagmi 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ type UseAccountConfig = {
|
|
|
41
41
|
/** Function to invoke when disconnected */
|
|
42
42
|
onDisconnect?(): void;
|
|
43
43
|
};
|
|
44
|
-
declare function useAccount({ onConnect, onDisconnect }?: UseAccountConfig): GetAccountResult<
|
|
44
|
+
declare function useAccount({ onConnect, onDisconnect }?: UseAccountConfig): GetAccountResult<PublicClient>;
|
|
45
45
|
|
|
46
46
|
type UseInfiniteQueryResult<TData, TError> = Pick<InfiniteQueryObserverResult<TData, TError>, 'data' | 'error' | 'fetchNextPage' | 'fetchStatus' | 'hasNextPage' | 'isError' | 'isFetched' | 'isFetchedAfterMount' | 'isFetching' | 'isFetchingNextPage' | 'isLoading' | 'isRefetching' | 'isSuccess' | 'refetch'> & {
|
|
47
47
|
isIdle: boolean;
|
package/dist/index.js
CHANGED
|
@@ -622,7 +622,12 @@ function useSyncExternalStoreWithTracked(subscribe, getSnapshot, getServerSnapsh
|
|
|
622
622
|
|
|
623
623
|
// src/hooks/accounts/useAccount.ts
|
|
624
624
|
function useAccount({ onConnect, onDisconnect } = {}) {
|
|
625
|
-
const
|
|
625
|
+
const config = useConfig();
|
|
626
|
+
const watchAccount_ = React9.useCallback(
|
|
627
|
+
(callback) => watchAccount(callback),
|
|
628
|
+
[config]
|
|
629
|
+
);
|
|
630
|
+
const account = useSyncExternalStoreWithTracked(watchAccount_, getAccount);
|
|
626
631
|
const previousAccountRef = React9.useRef();
|
|
627
632
|
const previousAccount = previousAccountRef.current;
|
|
628
633
|
React9.useEffect(() => {
|
|
@@ -831,8 +836,14 @@ function useDisconnect({
|
|
|
831
836
|
|
|
832
837
|
// src/hooks/accounts/useNetwork.ts
|
|
833
838
|
import { getNetwork, watchNetwork } from "@wagmi/core";
|
|
839
|
+
import { useCallback as useCallback5 } from "react";
|
|
834
840
|
function useNetwork() {
|
|
835
|
-
|
|
841
|
+
const config = useConfig();
|
|
842
|
+
const watchNetwork_ = useCallback5(
|
|
843
|
+
(callback) => watchNetwork(callback),
|
|
844
|
+
[config]
|
|
845
|
+
);
|
|
846
|
+
return useSyncExternalStoreWithTracked(watchNetwork_, getNetwork);
|
|
836
847
|
}
|
|
837
848
|
|
|
838
849
|
// src/hooks/accounts/useSignMessage.ts
|