app

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	// Name returns a descriptive name for the application, suitable for
	// display in logs.
	Name() string

	// Init performs any initialization work needed for the application.
	Init(ctx jsutil.AsyncContext, cleanup *jsutil.CleanupFuncs) error
}

App defines a WASM application that can be managed with the Run routine (see below).

type Context added in v0.0.27

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

func New

func New(app App) *Context

func (*Context) Release added in v0.0.27

func (a *Context) Release()

func (*Context) Run added in v0.0.27

func (a *Context) Run()

Run runs the application. Run is expected to be called directly from the main function of the program, and thus is permitted to block.

Run exports the following async functions to be available from Javascript:

initWaitFunc (see above): waits for app initialization to complete. If this
  function returns successfully, then the App.Init() function is guaranteed
  to have completed without error.

terminateFunc (see above): signals the application to terminate; Run() will
  terminate.

Jump to

Keyboard shortcuts

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