Skip to content

Commit

Permalink
prep: add router.context
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobrosenberg committed Dec 26, 2023
1 parent 25ffe89 commit 8180502
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/runtime/Router/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export class Router {
/** @type {UrlRewrite[]} */
urlRewrites = []

/** @type {RouterContext} */
context

/** @type { import('hookar').HooksCollection<RouterInitCallback> } */
beforeRouterInit = createSequenceHooksCollection()
/** @type { import('hookar').HooksCollection<RouterInitCallback> } */
Expand Down
1 change: 1 addition & 0 deletions lib/runtime/Router/Router.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
router = router || new Router(options)
router._claimed = true
const context = new RouterContext({ router })
router.context = context
router.onMount.run({ context, router })
context.decorators = context.decorators.map(normalizeDecorator)
Expand Down

0 comments on commit 8180502

Please sign in to comment.