All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.malliina.html.HtmlImplicits.scala Maven / Gradle / Ivy

There is a newer version: 6.9.4
Show newest version
package com.malliina.html

import com.malliina.http.FullUrl
import org.scalajs.dom.Element
import scalatags.JsDom.all.*

object HtmlImplicits extends HtmlImplicits

trait HtmlImplicits:
  given AttrValue[FullUrl] = attrType[FullUrl](_.url)

  def attrType[T](stringify: T => String): AttrValue[T] = (t: Element, a: Attr, v: T) =>
    t.setAttribute(a.name, stringify(v))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy