proivder with root_scope #1195
Replies: 1 comment 1 reply
-
Hmmm.... This is an interesting idea. It would certainly solve the issue of panicking if you forget to provide the context. However, overall I think it makes the flow of programs harder to reason about, because sibling components — or even "third cousin once-removed" cousins — gain the ability to provide context to one another. Imagine some silly tree like the below:
To me, the idea that these will implicitly be the same signal is troubling. And the fact that the behavior if you reorder the components is also troubling. This would also limit |
Beta Was this translation helpful? Give feedback.
-
provide_context(cx, set_toggled)
is not required.RootScope
if
use_context::<WriteSignal<bool>>(cx)
isNone
, one is created inRootScope
otherwise, return
the existing one
in ancestor.Of course, instead of returning a value directly, it is a closure with runtime/context
Beta Was this translation helpful? Give feedback.
All reactions