org.getshaka.shaka

Members list

Packages

Type members

Classlikes

trait Binding[V]

Base trait for Bindings. Since Bindings are hierarchical, they must manage registered child bindings.

Base trait for Bindings. Since Bindings are hierarchical, they must manage registered child bindings.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class NodeBinding[V]
class PropBinding[V]
class RootBinding
trait Component

A Shaka Component provides a template for some part of an application, as well as the means to render said template to the DOM.

A Shaka Component provides a template for some part of an application, as well as the means to render said template to the DOM.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait WebComponent
object Frag

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Frag.type
class LocalStorage[V](key: String)(implicit evidence$1: NativeConverter[V]) extends StorageManager[V]

Persists to LocalStorage
You should not use this StorageManager for types that may be Null or Unit, since localStorage returns only null if the value is undefined. Instead, use an Option type, or create your own StorageManager that uses a marker character when encountering null, like the ancient Linear A character "༗"

Persists to LocalStorage
You should not use this StorageManager for types that may be Null or Unit, since localStorage returns only null if the value is undefined. Instead, use an Option type, or create your own StorageManager that uses a marker character when encountering null, like the ancient Linear A character "༗"

Attributes

See also
Companion
object
Supertypes
trait StorageManager[V]
class Object
trait Matchable
class Any
object LocalStorage

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class NoStorage[V] extends StorageManager[V]

A no-op StorageManager

A no-op StorageManager

Attributes

Supertypes
trait StorageManager[V]
class Object
trait Matchable
class Any
class NodeBinding[V](state: State[V], parentElement: Element, builder: () ?=> V) extends Binding[V]

Binding subclass specialized for Nodes

Binding subclass specialized for Nodes

Type parameters

V

bound value type

Value parameters

builder

Function to create the DOM

parentElement

Element to append to

state

State this Binding is bound to

Attributes

Companion
object
Supertypes
trait Binding[V]
class Object
trait Matchable
class Any
object NodeBinding

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class OpenState[V](initialValue: V) extends State[V]

Open state that must be encapsulated.

Open state that must be encapsulated.

Type parameters

V

the value.

Value parameters

initialValue

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

Attributes

Supertypes
class State[V]
class Object
trait Matchable
class Any
class PropBinding[V](state: State[V], builder: () ?=> V) extends Binding[V]

Light-weight Binding subclass for binding CSS and JS properties.

Light-weight Binding subclass for binding CSS and JS properties.

Type parameters

V

the state value type

Value parameters

builder

Function binding the props

state

dependent State

Attributes

Supertypes
trait Binding[V]
class Object
trait Matchable
class Any
class RootBinding extends Binding[Unit]

Binding at the root of the heirarchy. Operations do nothing.

Binding at the root of the heirarchy. Operations do nothing.

Attributes

Supertypes
trait Binding[Unit]
class Object
trait Matchable
class Any
class SessionStorage[V](key: String)(implicit evidence$1: NativeConverter[V]) extends StorageManager[V]

Persists to Session Storage
You should not use this StorageManager for types that may be Null or Unit, since localStorage returns only null if the value is undefined. Instead, use an Option type, or create your own StorageManager that uses a marker character when encountering null, like the ancient Linear A character "༗"

Persists to Session Storage
You should not use this StorageManager for types that may be Null or Unit, since localStorage returns only null if the value is undefined. Instead, use an Option type, or create your own StorageManager that uses a marker character when encountering null, like the ancient Linear A character "༗"

Attributes

See also
Companion
object
Supertypes
trait StorageManager[V]
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
enum ShadowDom

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
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.

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

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

Used for fetching and storing States

Used for fetching and storing States

Type parameters

V

the value type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class LocalStorage[V]
class NoStorage[V]
class SessionStorage[V]
trait WebComponent extends Component

A [[Component]] wrapped in a Custom Element. Custom Elements have useful lifecycle callbacks and can attach shadow-dom.

A [[Component]] wrapped in a Custom Element. Custom Elements have useful lifecycle callbacks and can attach shadow-dom.

Attributes

See also
Companion
object
Supertypes
trait Component
class Object
trait Matchable
class Any
object WebComponent

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Types

opaque type Frag
type NodeBindingBuilder[V] = (Element, Binding[_]) ?=> V => Unit

Given a parent Element and Binding, returns a function from the State value V to Unit.

Given a parent Element and Binding, returns a function from the State value V to Unit.

Attributes

type PropBindingBuilder[V] = Binding[_] ?=> V => Unit

Given a parent Binding, returns a function from the State value V to Unit

Given a parent Binding, returns a function from the State value V to Unit

Attributes

Value members

Concrete methods

def render(comp: Component, element: Element): Unit
def render(frag: Frag, element: Element): Unit
def useState[V](initialValue: V): OpenState[V]

Open state that must be encapsulated. Similar in spirit to React's useState Hook.

Open state that must be encapsulated. Similar in spirit to React's useState Hook.

Attributes

Extensions

Extensions

extension (f: Frag)(f: Frag)
def render(using Element, Binding[_]): Unit