Skip to content

Commit

Permalink
Simplify attrs node building code
Browse files Browse the repository at this point in the history
  • Loading branch information
sloshy authored and davesmith00000 committed Sep 5, 2024
1 parent 6842dad commit 05a0745
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tyrian/src/main/scala/tyrian/runtime/Rendering.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ object Rendering:
onMsg: Msg => Unit,
key: Option[String]
): VNodeData =
val as: List[(String, String)] =
val as: List[(String, AttrValue)] =
attrs.collect {
case Attribute(n, v) => (n, v)
case NamedAttribute(n) => (n, "")
case Attribute(n, v) => (n, AttrValue(v))
case NamedAttribute(n) => (n, AttrValue(""))
}

val props: List[(String, PropValue)] =
Expand All @@ -43,7 +43,7 @@ object Rendering:

VNodeData.empty.copy(
props = props.toMap,
attrs = as.map((k, v) => k -> AttrValue(v)).toMap,
attrs = as.toMap,
on = events.toMap,
key = key
)
Expand Down

0 comments on commit 05a0745

Please sign in to comment.