give each app its own page, preloading and session stores, using context

This commit is contained in:
Rich Harris
2019-04-29 14:52:19 -04:00
parent 9c48e32a45
commit afeedf6bb2
17 changed files with 54 additions and 49 deletions

View File

@@ -204,10 +204,22 @@ export function get_page_handler(
});
const props = {
stores: {
page: {
subscribe: writable({
path: req.path,
query: req.query,
params
}).subscribe
},
preloading: {
subscribe: writable(null).subscribe
},
session: writable(session)
},
segments: layout_segments,
status: error ? status : 200,
error: error ? error instanceof Error ? error : { message: error } : null,
session: writable(session),
level0: {
props: preloaded[0]
},
@@ -231,12 +243,6 @@ export function get_page_handler(
}
}
stores.page.set({
path: req.path,
query: req.query,
params: params
});
const { html, head, css } = App.render(props);
const serialized = {