Add page.Store

Fixes #9546
This commit is contained in:
Bjørn Erik Pedersen
2022-02-22 14:42:33 +01:00
parent 7732da9f93
commit e97d3c640f
6 changed files with 69 additions and 1 deletions

View File

@@ -60,6 +60,9 @@ type pageCommon struct {
// Lazily initialized dependencies.
init *lazy.Init
// Store holds state that survives server rebuilds.
store *maps.Scratch
// All of these represents the common parts of a page.Page
maps.Scratcher
navigation.PageMenusProvider
@@ -134,6 +137,10 @@ type pageCommon struct {
forceRender bool
}
func (p *pageCommon) Store() *maps.Scratch {
return p.store
}
type pagePages struct {
pagesInit sync.Once
pages page.Pages