mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 03:25:24 +00:00
give each app its own page, preloading and session stores, using context
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user