page

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2020 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package page provides global pages that can be swapped in and out.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPages

func AddPages(pages ...Page) seed.Option

func GoBack

func GoBack() js.Script

func Harvest

func Harvest(starting Page) seed.Option

Harvest returns an option that adds all pages to the acting seed. This should normally only be called by app-level runtime packages such as seed/app.

func ID

func ID(p Page) string

ID returns the DOM id of the provided page.

func Is

func Is(p Page) *clientside.Bool

Is returns true if the given page is the current page.

func New

func New(options ...seed.Option) seed.Seed

func OnEnter

func OnEnter(f ...client.Script) seed.Option

func OnExit

func OnExit(f ...client.Script) seed.Option

func Refresh

func Refresh() js.Script

func Set

func Set(page Page) seed.Option

func SetPath

func SetPath(path string) seed.Option

SetPath sets the url path of this page.

func SetTitle

func SetTitle(title string) seed.Option

SetTitle sets the title of this page.

Types

type EnterIfOption

type EnterIfOption struct {
	// contains filtered or unexported fields
}

func EnterIf

func EnterIf(condition js.AnyBool) EnterIfOption

func (EnterIfOption) AddTo

func (e EnterIfOption) AddTo(c seed.Seed)

func (EnterIfOption) Else

func (e EnterIfOption) Else(do client.Script) seed.Option

type Page

type Page interface {
	Page(Router) seed.Seed
}

Page is a global view.

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router is responsible for showing the current page and routing urls to the approproate page.

func RouterOf

func RouterOf(c seed.Seed) Router

RouterOf returns the Router for the given seed.

func (Router) Goto

func (r Router) Goto(page Page) js.Script

Goto returns a script that goes to the given page.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL