Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dry-poets-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

`updated.check()` type changed to Promise<boolean>
1 change: 1 addition & 0 deletions packages/kit/src/runtime/client/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export function create_updated_store() {
/** @type {NodeJS.Timeout} */
let timeout;

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

Expand Down
2 changes: 1 addition & 1 deletion packages/kit/types/ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ declare module '$app/stores' {
/**
* 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.
*/
export const updated: Readable<boolean> & { check(): boolean };
export const updated: Readable<boolean> & { check(): Promise<boolean> };

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