Open LogicalTime opened 8 years ago
Yep. I remember having a similar conversation with a coworker. I think the wrapper was unnecessary in most cases, but there is some cases where it is necessary to wrap the rx in a real dom nodes (ie a rendered scalatag). The problem is using a def: Rx [HtmlTag]
inside an unrendered var: Rx [HtmlTag]
if no tag is rendered somewhere in the hierarchy the def ends up with a disconnected parent and the rx breaks. Our solution feels a bit heavy handed because we fixed it by just wrapping everything, but it does eliminate that really annoying corner case.
Do you think it would be possible without wrapping in a new node somehow. Adding a container node doesn't play well with bootstrap and I imagine other css.
e.g.
thead(
span(cls:="_rx")(
tr(th("txt1"), th("txt2"))
)
)
Perhaps we need a way to use/extend the context ownership pattern? Send like we are running into a pattern similar to what is described in the readme.
"Ownership fixes leaks by keeping allowing a parent Rx to track its "owned" nested Rx. That is whenever an Rx recaculates, it first kills all of its owned dependencies, ensuring they do not leak. In this example, c is the owner of all the Rxs which are created in mkRx and kills them automatically every time c recalculates"
Not having standard safe implicits is a barrier to using scalarx with scalajs. Below are links to several implementations people have come up with. It would be nice to have some standard implicits that we could refer to and that the community could improve over time.
Observations:
Implementations: