Skip to content

Commit

Permalink
Docs: child() strictness
Browse files Browse the repository at this point in the history
  • Loading branch information
raquo committed Oct 1, 2024
1 parent 90d238c commit 44af8c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website/docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 44af8c8

Please sign in to comment.