State

org.getshaka.shaka.State
abstract class State[V](initialValue: => V, storageManager: StorageManager[V])

A State that can be used to bind Nodes and their properties. You can get the current value with myState.value, and update with myState.value = newValue. These two methods are protected, so that state update logic is encapsulated within the object itself. This provides the same benefit as Redux's action - reducer - store trifecta.

Type parameters

V

the value.

Value parameters

initialValue

The State's initial value, discarded if the StorageManager can fetch a value.

storageManager

How the State should be persisted, such as in LocalStorage. By default, the State has no storage.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class OpenState[V]

Members list

Value members

Concrete methods

def bind(builder: () ?=> V)(using pe: Element, pb: Binding[_]): Unit

Construct a Binding for DOM Nodes

Construct a Binding for DOM Nodes

Attributes

def bindProps(builder: () ?=> V)(using pb: Binding[_]): Unit

Construct a lighter-weight Binding for CSS/JS Props.

Construct a lighter-weight Binding for CSS/JS Props.

Attributes

def removeBinding(b: Binding[V]): Unit

Removes a Binding from this State.

Removes a Binding from this State.

Attributes