-Update - i figured it out, in svelte land you put a $ in front to autosubscribe
I am working on evaluating svelte-query and so far i am having an issue where it seems i have to subscribe to get the results instead of the hook automatically subscribing and giving me the results
for example, i can only get the custom hook results to work like below
<script>
import {useQuery} from "@sveltestack/svelte-query";
import {useListPets} from "./pets/pets";
let pets;
const listPets = useListPets();
listPets.subscribe(val => {pets = val})
console.log(listPets)
</script>
{#if (pets.isLoading)}
<div>Loading The Query</div>
{/if}
{#if (pets.isError)}<div>!!!! ERROR</div>{/if}
{#if (pets.isSuccess)}<div>OK SUCCESS</div>{/if}
i was expecting it to work more like this (shown in the documentation)
<script>
import {useQuery} from "@sveltestack/svelte-query";
import {useListPets} from "./pets/pets";
const listPets = useListPets();
console.log(listPets)
</script>
{#if (listPets .isLoading)}
<div>Loading The Query</div>
{/if}
{#if (listPets .isError)}<div>!!!! ERROR</div>{/if}
{#if (listPets .isSuccess)}<div>OK SUCCESS</div>{/if}
-Update - i figured it out, in svelte land you put a $ in front to autosubscribe
I am working on evaluating svelte-query and so far i am having an issue where it seems i have to subscribe to get the results instead of the hook automatically subscribing and giving me the results for example, i can only get the custom hook results to work like below
i was expecting it to work more like this (shown in the documentation)
my pets hook looks like this