package
Version:
v1.4.0
Opens a new window with list of versions in this module.
Published: Jan 31, 2020
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package worker contains Go web-worker WASM module bridge methods
BindValue binds JS value to specified target
FuncOf wraps function into js-compatible async function with callback
NewTypeError creates a new type error
ParseArgs parses async call arguments.
Function expects the last argument to be a callable JS function
Args is collection if function call arguments
func (args Args) Bind(targets ...interface{}) error
Bind binds passed JS arguments to Go values
Function supports *int, *bool, *string and ValueUnmarshaler values.
func (args Args) BindIndex(index int, dest interface{}) error
BindIndex binds argument at specified index to passed value
type Callback = func(interface{}, error)
Callback is async function callback
Func is worker handler function
type Response struct {
Error string `json:"error,omitempty"`
Result interface{} `json:"result,omitempty"`
}
type ValueUnmarshaler interface {
UnmarshalValue(js.Value) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.