From 0d9c63b828f471664a7624558e287eb9df87f8e5 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 17 Mar 2024 20:09:19 +0100 Subject: [PATCH] fix(nuxt): correct `finish` types and add to docs resolves https://github.com/nuxt/nuxt/issues/26317 --- docs/3.api/2.composables/use-loading-indicator.md | 2 +- packages/nuxt/src/app/composables/loading-indicator.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/3.api/2.composables/use-loading-indicator.md b/docs/3.api/2.composables/use-loading-indicator.md index a451518d71..2e4a5bb97b 100644 --- a/docs/3.api/2.composables/use-loading-indicator.md +++ b/docs/3.api/2.composables/use-loading-indicator.md @@ -39,7 +39,7 @@ Set `isLoading` to true and start to increase the `progress` value. ### `finish()` -Set the `progress` value to `100`, stop all timers and intervals then reset the loading state `500` ms later. +Set the `progress` value to `100`, stop all timers and intervals then reset the loading state `500` ms later. `finish` accepts a `{ force: true }` option to skip the interval before the state is reset. ### `clear()` diff --git a/packages/nuxt/src/app/composables/loading-indicator.ts b/packages/nuxt/src/app/composables/loading-indicator.ts index 191841d46d..7037f74438 100644 --- a/packages/nuxt/src/app/composables/loading-indicator.ts +++ b/packages/nuxt/src/app/composables/loading-indicator.ts @@ -25,7 +25,7 @@ export type LoadingIndicator = { isLoading: Ref start: () => void set: (value: number) => void - finish: (opts: { force?: boolean }) => void + finish: (opts?: { force?: boolean }) => void clear: () => void }