pikax/vue-composable

Feat/add axios composable

damienroche opened this issue · 0 comments

Hi there,
it would be nice to have access to a boolean like isFinished (like in vueUse/useAxios ) to indicates if the request is finished.
For example, this boolean can be useful is this case :

<template>
  <div>
    <div v-if="isFinished && items.length === 0>
      No items in database
      <button @click="createItem">Create your fist item</button>
    </div>
    <ul v-else>
      <li v-for="item in items">
        ....
      </li>
    </ul>
  </div>
</template>

<script lang="ts" setup>
const items = ref([])
const { isFinished, exec } = useAxios()
...
</script>