From 44af8c8703ec1f3ed07b59f3678975c114191bec Mon Sep 17 00:00:00 2001 From: Nikita Gazarov Date: Mon, 30 Sep 2024 20:38:16 -0700 Subject: [PATCH] Docs: child() strictness --- website/docs/documentation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/documentation.md b/website/docs/documentation.md index 649f342..0fb3ad6 100644 --- a/website/docs/documentation.md +++ b/website/docs/documentation.md @@ -1207,6 +1207,8 @@ div( ) ``` +`child(div("Hello")) <-- boolSignal` is equivalent to `val el = div("Hello"); child <-- boolSignal.map(if (_) el else emptyNode)`. Note that `el` is evaluated strictly, eagerly, and only once – when you call `child()`. Thus, the same element will be re-mounted if `boolSignal` switches from `true` to `false` and back to `true` again. Similarly for the `children()` helper. + ## Rendering Loading State