Skip to content

Instantly share code, notes, and snippets.

@bermudalocket
Created August 31, 2022 16:36
Show Gist options
  • Save bermudalocket/6a19276760963574f7aac47ab3b9d355 to your computer and use it in GitHub Desktop.
Save bermudalocket/6a19276760963574f7aac47ab3b9d355 to your computer and use it in GitHub Desktop.

$app/stores

Server stores are contextual -- they are added to the context of the root component.

import { getStores, navigating, page, updated } from "$app/stores";

getStores

Returns all contextual stores. Must be called during component initialization. ==Only use this if you need to defer store subscription until after the component has mounted, for some reason.==

function getStores(): {
	navigating: typeof navigating;
	page: typeof page;
	updated: typeof updated;
}

page

A readable store containing page data.

const page: Readable<Page>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment