You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
The Hands on Scalajs book has a recommended implicit that needs to be updated asap.
Some people's implicits use .toTry and get values safely, some do not
Some people implicits wrap the rx value in a container node, making it easy to remove all child nodes. However adding these intermediate nodes doesn't work well when using libraries like bootstrap. (example Voltir/framework)
I am not sure how to combine safety, being sure to remove/replace all children, and not creating a container node that messes up bootstrap css/js.
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.
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:
The text was updated successfully, but these errors were encountered: