KeySetter

com.raquo.laminar.modifiers.KeySetter
See theKeySetter companion object
class KeySetter[K <: Key, V, -El <: Base](val key: K, val value: V, val action: (El, K, V) => Unit) extends Setter[El]

This class represents a modifier that sets a Key (e.g. an attribute or a style) to a specific value on a El. action is what performs this change.

These modifiers are not only idempotent, but are also expected to be undoable, that is, calling key := value2 will override key := value1. In contrast, that is not the case for cls := "class" for example, which adds a class instead of setting it. Such cls modifiers are CompositeKeySetter, which does not extend KeySetter. // #TODO the naming of these traits is confusing...

Attributes

Companion
object
Graph
Supertypes
trait Setter[El]
trait Modifier[El]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def apply(element: El): Unit

You can count on this method being a no-op in your libraries and end user code.

You can count on this method being a no-op in your libraries and end user code.

The reason this method is not abstract is to avoid broken SAM sugar in case of meta modifiers. See https://github.com/raquo/scala-dom-types/issues/27

Attributes

Definition Classes

Concrete fields

val action: (El, K, V) => Unit
val key: K
val value: V