Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove wrapping request args in reactive to fix memory leak (#3612)

authored by

Vlad and committed by
GitHub
5d9d1343 58d7b9f1

+9 -8
+5
.changeset/quick-pens-battle.md
··· 1 + --- 2 + '@urql/vue': minor 3 + --- 4 + 5 + Remove wrapping request `args` in `reactive` to fix memory leak
+2 -4
packages/vue-urql/src/useQuery.ts
··· 1 1 /* eslint-disable react-hooks/rules-of-hooks */ 2 2 3 3 import type { Ref, WatchStopHandle } from 'vue'; 4 - import { isRef, reactive, ref, shallowRef, watch, watchEffect } from 'vue'; 4 + import { isRef, ref, shallowRef, watch, watchEffect } from 'vue'; 5 5 6 6 import type { Subscription, Source } from 'wonka'; 7 7 import { pipe, subscribe, onEnd } from 'wonka'; ··· 241 241 } 242 242 243 243 export function callUseQuery<T = any, V extends AnyVariables = AnyVariables>( 244 - _args: UseQueryArgs<T, V>, 244 + args: UseQueryArgs<T, V>, 245 245 client: Ref<Client> = useClient(), 246 246 stops: WatchStopHandle[] = [] 247 247 ): UseQueryResponse<T, V> { 248 - const args = reactive(_args) as UseQueryArgs<T, V>; 249 - 250 248 const data: Ref<T | undefined> = ref(); 251 249 const stale: Ref<boolean> = ref(false); 252 250 const fetching: Ref<boolean> = ref(false);
+2 -4
packages/vue-urql/src/useSubscription.ts
··· 4 4 import { pipe, subscribe, onEnd } from 'wonka'; 5 5 6 6 import type { Ref, WatchStopHandle } from 'vue'; 7 - import { isRef, reactive, ref, shallowRef, watch, watchEffect } from 'vue'; 7 + import { isRef, ref, shallowRef, watch, watchEffect } from 'vue'; 8 8 9 9 import type { 10 10 Client, ··· 239 239 R = T, 240 240 V extends AnyVariables = AnyVariables, 241 241 >( 242 - _args: UseSubscriptionArgs<T, V>, 242 + args: UseSubscriptionArgs<T, V>, 243 243 handler?: MaybeRef<SubscriptionHandler<T, R>>, 244 244 client: Ref<Client> = useClient(), 245 245 stops: WatchStopHandle[] = [] 246 246 ): UseSubscriptionResponse<T, R, V> { 247 - const args = reactive(_args) as UseSubscriptionArgs<T, V>; 248 - 249 247 const data: Ref<R | undefined> = ref(); 250 248 const stale: Ref<boolean> = ref(false); 251 249 const fetching: Ref<boolean> = ref(false);