diff --git a/code/websites/pokedex.online/src/composables/useAsyncState.js b/code/websites/pokedex.online/src/composables/useAsyncState.js index 99d9aff..26f566a 100644 --- a/code/websites/pokedex.online/src/composables/useAsyncState.js +++ b/code/websites/pokedex.online/src/composables/useAsyncState.js @@ -1,9 +1,9 @@ /** * useAsyncState Composable - * + * * Manages loading/error/success states for async operations * Consolidates pattern used across 13+ components - * + * * @example * const { execute, loading, error, data, isSuccess } = useAsyncState(); * await execute(async () => { @@ -27,9 +27,13 @@ export function useAsyncState(options = {}) { const data = ref(initialData); const abortController = ref(null); - const isSuccess = computed(() => !loading.value && !error.value && data.value !== null); + const isSuccess = computed( + () => !loading.value && !error.value && data.value !== null + ); const isError = computed(() => !loading.value && error.value !== null); - const isIdle = computed(() => !loading.value && error.value === null && data.value === null); + const isIdle = computed( + () => !loading.value && error.value === null && data.value === null + ); /** * Execute an async function with state management @@ -74,7 +78,9 @@ export function useAsyncState(options = {}) { // If more retries remaining, wait before retrying if (attempt <= retries) { - await new Promise(resolve => setTimeout(resolve, retryDelay * attempt)); + await new Promise(resolve => + setTimeout(resolve, retryDelay * attempt) + ); } } }