Skip to content

Commit e379a5d

Browse files
authored
[fix] updated.check() is promise<boolean> (#8400)
1 parent 5d9257c commit e379a5d

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.changeset/dry-poets-crash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
`updated.check()` type changed to Promise<boolean>

packages/kit/src/runtime/client/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export function create_updated_store() {
211211
/** @type {NodeJS.Timeout} */
212212
let timeout;
213213

214+
/** @type {() => Promise<boolean>} */
214215
async function check() {
215216
if (DEV || !BROWSER) return false;
216217

packages/kit/types/ambient.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ declare module '$app/stores' {
320320
/**
321321
* A readable store whose initial value is `false`. If [`version.pollInterval`](https://kit.svelte.dev/docs/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update the store value to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling.
322322
*/
323-
export const updated: Readable<boolean> & { check(): boolean };
323+
export const updated: Readable<boolean> & { check(): Promise<boolean> };
324324

325325
/**
326326
* A function that returns all of the contextual stores. On the server, this must be called during component initialization.

0 commit comments

Comments
 (0)