jscache

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package jscache caches expensive JavaScript results, like string encoding

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Strings

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

Strings caches encoding strings as safejs.Value's. String encoding today is quite CPU intensive, so caching commonly used strings helps with performance.

func (*Strings) GetProperty

func (c *Strings) GetProperty(obj safejs.Value, key string) (safejs.Value, error)

GetProperty retrieves the given object's property, using a cached string value if available. Saves on the performance cost of 2 round trips to JS.

func (*Strings) Value

func (c *Strings) Value(s string) safejs.Value

Value retrieves the safejs.Value for the given string

Jump to

Keyboard shortcuts

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