From bb0783b62796e3dab0c179244c7f28db77fbe47a Mon Sep 17 00:00:00 2001 From: Naftoli Gugenheim Date: Mon, 29 Jun 2020 02:10:11 -0400 Subject: [PATCH] =?UTF-8?q?PropTypes.Prop:=20add=20`:=3D=3F`=20for=20`Opti?= =?UTF-8?q?on`al=20`Setting`s?= --- .../src/main/scala/io/github/nafg/simplefacade/PropTypes.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/simpleFacade/src/main/scala/io/github/nafg/simplefacade/PropTypes.scala b/simpleFacade/src/main/scala/io/github/nafg/simplefacade/PropTypes.scala index 4f1c6ce..0c22361 100644 --- a/simpleFacade/src/main/scala/io/github/nafg/simplefacade/PropTypes.scala +++ b/simpleFacade/src/main/scala/io/github/nafg/simplefacade/PropTypes.scala @@ -16,6 +16,7 @@ object PropTypes { class Prop[A](val name: String)(implicit writer: Writer[A]) { def :=(value: A): Setting = new Setting(name, writer.write(value)) + def :=?(value: Option[A]): Setting = new Setting(name, value.map(writer.write).getOrElse(js.undefined)) } trait WithChildren[C] extends PropTypes {