Open jokade opened 7 years ago
Case classes annotated with @Data should be translated into plain JS objects when compiled with Scala.js (and be ignored with Scala/JVM).
@Data
Example: when Node is defined as
Node
@Data case class Node(id: Int, label: Option[String] = None, children: Seq[Node] = Nil)
then
Node(1, label = Some("root"), children = Seq( Node(2, label = Some("child1")), Node(3) ))
should translate to
{id: 1, label: "root", children: [{id: 2, label: "child1", children: []}, {id: 3, label: undefined, children: []}]}
Case classes annotated with
@Data
should be translated into plain JS objects when compiled with Scala.js (and be ignored with Scala/JVM).Example: when
Node
is defined asthen
should translate to