com.raquo.domtypes.generic.codecs

Type members

Classlikes

trait AsIsCodec[T] extends Codec[T, T]

Use this codec when you don't need any data transformation

Use this codec when you don't need any data transformation

Companion
object
object AsIsCodec
Companion
class
object BooleanAsAttrPresenceCodec extends Codec[Boolean, String]
object BooleanAsIsCodec extends AsIsCodec[Boolean]
object BooleanAsOnOffStringCodec extends Codec[Boolean, String]
object BooleanAsTrueFalseStringCodec extends Codec[Boolean, String]
object BooleanAsYesNoStringCodec extends Codec[Boolean, String]
trait Codec[ScalaType, DomType]

This trait represents a way to encode and decode HTML attribute or DOM property values.

This trait represents a way to encode and decode HTML attribute or DOM property values.

It is needed because attributes encode all values as strings regardless of their type, and then there are also multiple ways to encode e.g. boolean values. Some attributes encode those as "true" / "false" strings, others as presence or absence of the element, and yet others use "yes" / "no" or "on" / "off" strings, and properties encode booleans as actual booleans.

Scala DOM Types hides all this mess from you using codecs. All those pseudo-boolean attributes would be simply Attr[Boolean](name, codec) in your code.

object DoubleAsIsCodec extends AsIsCodec[Double]
object DoubleAsStringCodec extends Codec[Double, String]
object IntAsIsCodec extends AsIsCodec[Int]
object IntAsStringCodec extends Codec[Int, String]
object IterableAsCommaSeparatedStringCodec extends Codec[Iterable[String], String]
object IterableAsSpaceSeparatedStringCodec extends Codec[Iterable[String], String]
object StringAsIsCodec extends AsIsCodec[String]