actions

package
v0.0.0-...-dd3fdab Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(action interface{})

Dispatch dispatches the given action to all registered callbacks.

func Unregister

func Unregister(id ID)

Unregister unregisters the callback previously registered via a call to RegisterOnAction.

Types

type Back

type Back struct{}

Back button pressed. Navigate to previous page.

type Context

type Context struct {
	// Defines the current page.
	Page Page
	// Referrer contains information on last page visited.
	Referrer *Context
}

Context contains all information to completely define a page layout. It also has information on last page visited to enable the use of a "back" button. It is not an "action" item strictly speaking.

type DownloadShapeSTL

type DownloadShapeSTL struct {
	Shape model.Shape3D
}

type GetShape

type GetShape struct{}

GetShape action.

type ID

type ID int

ID is a unique identifier representing a registered callback function.

func Register

func Register(callback func(action interface{})) ID

Register registers the callback to handle dispatched actions, the returned ID may be used to unregister the callback later.

type Page

type Page int
const (
	PageLanding Page = iota
	PageNewItem
)

type PageSelect

type PageSelect struct {
	Page Page
}

PageSelect Navigates view to new page.

type Refresh

type Refresh struct{}

Refresh just updates page by calling rendering functions.

Jump to

Keyboard shortcuts

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