package jscache

import "github.com/hack-pad/go-indexeddb/idb/internal/jscache"

Index

Types

type Strings

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

Strings caches encoding strings as js.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 js.Value, key string) js.Value

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) js.Value

Value retrieves the js.Value for the given string

Source Files

cacher.go strings.go

Version
v0.2.0
Published
Apr 30, 2022
Platform
js/wasm
Imports
1 packages
Last checked
4 hours ago

Tools for package owners.