Closed stefanprobst closed 1 year ago
this adds a typed api client for the mmp rest api with request deduplication and response caching.
use like this:
<script lang="ts" setup> import { useAuthors } from '@/api' const { data, status, error } = useAuthors() </script>
when passing params, make sure to pass a ref if the query should update when params change:
ref
<script lang="ts" setup> import { ref } from 'vue'; import type { GetAuthors } from '@/api'; import { useAuthors } from '@/api'; const searchParams = ref<GetAuthors.SearchParams>({ name: 'stefan' }); const { data, status, error } = useAuthors(searchParams); </script>
this adds a typed api client for the mmp rest api with request deduplication and response caching.
use like this:
when passing params, make sure to pass a
ref
if the query should update when params change: