Skip to content
Discussion options

You must be logged in to vote

I'd been facing the same issue, but now I'm reusing a query like:

$lib/stores/queries

export const useSomethingQuery = () =>
	createQuery({
		queryKey: ['something'],
		queryFn: getSomething,
	});

+page.svelte

<script lang="ts">
	import { useSomethingQuery } from '$lib/stores/queries';

	const something = useSomethingQuery();

	// ...
</script>

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@MarArMar
Comment options

@woojunro
Comment options

Answer selected by MarArMar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants