`useAsyncState` equivalent in Nuxt

Hey. Up until now I've been using useAsyncState from VueUse when doing any CRUD work through a service of mine, and I'm curious if this is bad practice and if there's an equivalent function baked into Nuxt?
Today I'm doing something like this, which I'm looking to translate similarly to a Nuxt composable of some sort:
const { isLoading, execute: createApiKey } = useAsyncState(async (name: string) => {
  await CustomersService.create({ name: name });
}, null, {
  immediate: false,
  onError: (error) => {
    useApiErrorToast(error);
  }
});
Was this page helpful?