feat: add loader spinner to API loader

This commit is contained in:
2023-05-08 03:34:48 +02:00
parent 8cbd1dbf07
commit de2f11f8fe
3 changed files with 53 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
<template>
<Cache name="repos" :callback="fetchData" @cached="processCachedData" />
<slot v-if="loading" name="loader"></slot>
<slot v-if="loading" name="loader">
<Loader />
</slot>
<slot v-else-if="error" name="error"></slot>
<slot v-else>
{{ error }}
@@ -9,6 +11,7 @@
<script setup lang="ts">
import Cache from './Cache.vue';
import Loader from './Loader.vue';
import { Ref, ref } from 'vue';
import { Observable, catchError, switchMap, throwError } from 'rxjs';