Closed wobsoriano closed 12 months ago
This PR adds a useMutation composable kinda similar to TanStack Query useMutation:
useMutation
<script setup lang="ts"> const { $client } = useNuxtApp() const { mutate, pending, error } = $client.login.useMutation() const handleLogin = () => { const name = 'John Doe'; mutate({ name }); } </script> <template> <h1>Login Form</h1> <button :disabled="pending" @click="handleLogin" > Login </button> <div v-if="error"> Something went wrong </div> </template>
Needs improvement but it works for now!
The latest updates on your projects. Learn more about Vercel for Git ↗︎
This PR adds a
useMutation
composable kinda similar to TanStack Query useMutation:Needs improvement but it works for now!