From 3ff64451c380c96ebd893ef8e1501cc3d6638ddc Mon Sep 17 00:00:00 2001 From: gabrieldemian Date: Wed, 11 Jan 2023 12:12:45 -0300 Subject: [PATCH] updated solid query --- packages/solid/package.json | 2 +- packages/solid/src/context.tsx | 6 +----- .../solid/src/hooks/accounts/useAccount.test.ts | 5 +++-- packages/solid/src/hooks/accounts/useAccount.tsx | 5 ++++- packages/solid/test/index.tsx | 4 ++-- pnpm-lock.yaml | 14 +++++++++----- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/solid/package.json b/packages/solid/package.json index fa8e4fe555..b571bcfc2c 100644 --- a/packages/solid/package.json +++ b/packages/solid/package.json @@ -101,7 +101,7 @@ "dependencies": { "@coinbase/wallet-sdk": "^3.6.0", "@tanstack/query-sync-storage-persister": "^4.14.5", - "@tanstack/solid-query": "^4.20.9", + "@tanstack/solid-query": "^4.22.0", "@wagmi/core": "workspace:*", "@walletconnect/ethereum-provider": "^1.8.0", "abitype": "^0.2.5", diff --git a/packages/solid/src/context.tsx b/packages/solid/src/context.tsx index ec5a0408bc..b33a920cb5 100644 --- a/packages/solid/src/context.tsx +++ b/packages/solid/src/context.tsx @@ -10,7 +10,6 @@ export const Context = createContext< >(undefined) const queryClient = new QueryClient() -const queryClientContext = createContext(queryClient) export type WagmiConfigProps< TProvider extends Provider = Provider, @@ -25,10 +24,7 @@ export function WagmiProvider< TWebSocketProvider extends WebSocketProvider, >(props: ParentProps>) { return ( - + {props.children} diff --git a/packages/solid/src/hooks/accounts/useAccount.test.ts b/packages/solid/src/hooks/accounts/useAccount.test.ts index 10642c3a1a..432f13dd03 100644 --- a/packages/solid/src/hooks/accounts/useAccount.test.ts +++ b/packages/solid/src/hooks/accounts/useAccount.test.ts @@ -11,14 +11,15 @@ const useAccountWithConnectAndDisconnect = () => { } } +const { result } = renderHook(() => useAccountWithConnectAndDisconnect()) + describe('useAccount', () => { describe('mounts', () => { it('is connected', async () => { - const { result } = renderHook(() => useAccountWithConnectAndDisconnect()) - // const connectData = renderHook(() => useConnect()) console.log('accountData -> ', result.account()) + // console.log('connectData -> ', result.connect()) expect(true).toBeTruthy() diff --git a/packages/solid/src/hooks/accounts/useAccount.tsx b/packages/solid/src/hooks/accounts/useAccount.tsx index 8a6892f6af..e739b4edaf 100644 --- a/packages/solid/src/hooks/accounts/useAccount.tsx +++ b/packages/solid/src/hooks/accounts/useAccount.tsx @@ -5,7 +5,10 @@ import { createEffect, createSignal, onCleanup } from 'solid-js' // import { useClient } from '../../context' export const useAccount = () => { - // const [client] = useClient() + // const client = useClient() + + // console.log('client -> ', client) + const [accountResult, setAccountResult] = createSignal< GetAccountResult >({ diff --git a/packages/solid/test/index.tsx b/packages/solid/test/index.tsx index c716ddae30..b288c032f9 100644 --- a/packages/solid/test/index.tsx +++ b/packages/solid/test/index.tsx @@ -15,6 +15,7 @@ const wrapper = ({ client = setupClient({ queryClient }), ...rest }: Props = {}) => { + console.log('rest', rest) return } @@ -33,6 +34,7 @@ export function renderHook( // }), // ...options_, // } + // const utils = defaultRenderHook(hook, options as any) queryClient.clear() @@ -41,8 +43,6 @@ export function renderHook( ...options_, } as any) - // const utils = defaultRenderHook(hook, options as any) - return { ...utils, } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 57d9274a8c..8cd8b7364f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -245,7 +245,7 @@ importers: specifiers: '@coinbase/wallet-sdk': ^3.6.0 '@tanstack/query-sync-storage-persister': ^4.14.5 - '@tanstack/solid-query': ^4.20.9 + '@tanstack/solid-query': ^4.22.0 '@wagmi/core': workspace:* '@walletconnect/ethereum-provider': ^1.8.0 abitype: ^0.2.5 @@ -257,7 +257,7 @@ importers: dependencies: '@coinbase/wallet-sdk': 3.6.3 '@tanstack/query-sync-storage-persister': 4.20.9 - '@tanstack/solid-query': 4.20.9_solid-js@1.6.8 + '@tanstack/solid-query': 4.22.0_solid-js@1.6.8 '@wagmi/core': link:../core '@walletconnect/ethereum-provider': 1.8.0 abitype: 0.2.5_typescript@4.9.4 @@ -3209,6 +3209,10 @@ packages: resolution: {integrity: sha512-XTEEvOGy7wlABPTYfmg7U287WYcf2PV8lH15oKWD2I09okqMOHrB23WxyikEVRwJCjYNKcCW0BuYaAY4S2g/jg==} dev: false + /@tanstack/query-core/4.22.0: + resolution: {integrity: sha512-OeLyBKBQoT265f5G9biReijeP8mBxNFwY7ZUu1dKL+YzqpG5q5z7J/N1eT8aWyKuhyDTiUHuKm5l+oIVzbtrjw==} + dev: false + /@tanstack/query-persist-client-core/4.20.9: resolution: {integrity: sha512-dwE3A7ZKeGsOcqnfqY8H/1Q6g0GrrDSarhVK0QqMKV9crRW87gz1wG37+2YHJettL8CC36S7SqLJGQCoViUCiw==} peerDependencies: @@ -3252,12 +3256,12 @@ packages: use-sync-external-store: 1.2.0_react@18.2.0 dev: false - /@tanstack/solid-query/4.20.9_solid-js@1.6.8: - resolution: {integrity: sha512-A27K9myMrtcN+sUHmCTcX6SUf3TlQv+OsnC4hep4V0gVfB+44lloC1uZAIM7CT6WPkebqiyQ1toTl3P+/xs1EQ==} + /@tanstack/solid-query/4.22.0_solid-js@1.6.8: + resolution: {integrity: sha512-xNS9tS1XGAY1CD2i6+Lo31wFbizMPPO+NfT3E1E8EFq4Y6t2ewrcEI43X7Wl9mKrntWfLLD75KvnK5LWDhpCiw==} peerDependencies: solid-js: ^1.5.7 dependencies: - '@tanstack/query-core': 4.20.9 + '@tanstack/query-core': 4.22.0 solid-js: 1.6.8 dev: false