メインコンテンツへスキップ

$app/stores

import { 
function getStores(): {
    page: typeof page;
    navigating: typeof navigating;
    updated: typeof updated;
}
getStores
, const navigating: Readable<Navigation | null>

A readable store. When navigating starts, its value is a Navigation object with from, to, type and (if type === 'popstate') delta properties. When navigating finishes, its value reverts to null.

On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time.

navigating
, const page: Readable<Page<Record<string, string>, string | null>>

A readable store whose value contains page data.

On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time.

page
,
const updated: Readable<boolean> & {
    check(): Promise<boolean>;
}

A readable store whose initial value is false. If version.pollInterval 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.

On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time.

updated
} from '$app/stores';

getStores

function getStores(): {
	page: typeof page;

	navigating: typeof navigating;

	updated: typeof updated;
};

読み取り可能なストア。ナビゲーションが開始されると、値はNavigationオブジェクトになり、fromtotype、(そしてtype === 'popstate'の場合)deltaプロパティが含まれます。ナビゲーションが完了すると、値はnullに戻ります。

サーバーでは、このストアをコンポーネントの初期化中にのみサブスクライブできます。ブラウザでは、いつでもサブスクライブできます。

const navigating: import('svelte/store').Readable<
	import('@sveltejs/kit').Navigation | null
>;

page

ページデータを含む値を持つ、読み取り可能なストア。

サーバーでは、このストアをコンポーネントの初期化中にのみサブスクライブできます。ブラウザでは、いつでもサブスクライブできます。

const page: import('svelte/store').Readable<
	import('@sveltejs/kit').Page
>;

updated

その初期値が『false』である、読み込み可能なストア。もしversion.pollInterval値がゼロ以外であれば、SvelteKitはアプリケーションの新しいバージョンをポーリングし、それらを検出するとストア値を『true』に更新する。updated.check()は、ポーリングに関係なく、強制的に即時にチェックする。

サーバーでは、このストアをコンポーネントの初期化中にのみサブスクライブできます。ブラウザでは、いつでもサブスクライブできます。

const updated: import('svelte/store').Readable<boolean> & {
	check(): Promise<boolean>;
};

このページをGitHubで編集する