Documentation
¶
Index ¶
- func MustRemember[T any](c SupportState, key string, calc func() T) T
- func Remember[T any](c SupportState, key string, calc func() T) (T, error)
- func RememberUnsafe[T any](c SupportState, key string, calc func() T) T
- type Memo
- type MemoTyped
- type MutableValue
- type PersistentState
- type SupportState
- type TypedMutableValue
- type TypedValue
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustRemember ¶
func MustRemember[T any](c SupportState, key string, calc func() T) T
func RememberUnsafe ¶
func RememberUnsafe[T any](c SupportState, key string, calc func() T) T
Types ¶
type Memo ¶
type Memo = immap.ImmutableMap[any]
type MemoTyped ¶
type MemoTyped[T any] = immap.ImmutableMap[T]
type MutableValue ¶
type PersistentState ¶
type PersistentState interface {
GetState(key string, initial func() any) MutableValue
SetOnStateChange(callback func())
}
type SupportState ¶
type TypedMutableValue ¶
type TypedMutableValue[T any] interface { TypedValue[T] Set(value T) Unwrap() MutableValue }
type TypedValue ¶
type TypedValue[T any] interface { Get() T }
Click to show internal directories.
Click to hide internal directories.