Skip to content

Commit

Permalink
Make CustomTag and CustomAttributes case classes
Browse files Browse the repository at this point in the history
  • Loading branch information
joan38 committed Jan 21, 2020
1 parent 77fa252 commit 68b7a24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/scala/slinky/core/TagComponent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import scala.scalajs.js
import scala.scalajs.js.{Dictionary, JSON}
import scala.language.higherKinds

trait Tag extends Any {
trait Tag {
type tagType <: TagElement
def apply(mods: TagMod[tagType]*): WithAttrs[tagType]
}

final class CustomTag(@inline private val name: String) extends Tag {
final case class CustomTag(@inline private val name: String) extends Tag {
override type tagType = Nothing

@inline def apply(mods: TagMod[tagType]*): WithAttrs[tagType] = {
Expand All @@ -29,7 +29,7 @@ abstract class TagElement {
type RefType
}

final class CustomAttribute[T](@inline private val name: String) {
final case class CustomAttribute[T](@inline private val name: String) {
@inline def :=(v: T) = new AttrPair[Any](name, v.asInstanceOf[js.Any])
@inline def :=(v: Option[T]) = new OptionalAttrPair[Any](name, v.asInstanceOf[Option[js.Any]])
}
Expand Down

0 comments on commit 68b7a24

Please sign in to comment.