NuxtN
Nuxt9mo ago
5 replies
Lex

useFetch automatically fetching even when watch is disabled

I have the following code snippet:
const wallet = useWallet();
const block = ref<number | null>(null);

const { data, status, execute } = useFetch("/api/transcations", {
   query: {
      wallet,
      start_block: block,
   },
   immediate: false,
   watch: false,
});

Ref block is connected via v-model to input element. When I type into that element and block gets updated, it auto starts fetching. I want this to only be fetched when I manually run execute() - am I missing something?
Was this page helpful?