tinygojs

package
v1.34.9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package tinygojs centralizes TinyGo-safe syscall/js helper calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available(fn js.Value) bool

Available returns true if fn is a callable JavaScript value.

func AwaitPromise

func AwaitPromise(promise js.Value, thenCb, catchCb js.Func)

AwaitPromise attaches promise completion callbacks through a JS-owned helper when available. The helper defers callback execution away from the current JS event frame for TinyGo asyncify builds.

func Call

func Call(target js.Value, method string, args ...any) js.Value

Call calls target[method](...args), using a JS-owned helper when available.

func New

func New(ctor js.Value, args ...any) js.Value

New constructs ctor with args, using a JS-owned helper when available.

func RejectionMessage

func RejectionMessage(value js.Value) string

RejectionMessage returns a conservative error message for a JS promise rejection. Bldr's TinyGo helper passes numeric error classes instead of raw browser Error objects to avoid TinyGo stringifying arbitrary JS values.

func UseHelpers

func UseHelpers() bool

UseHelpers reports whether TinyGo-specific JavaScript helpers may be used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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