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
Even if <export-child>'s a and b change in a batch to truthy values, <import-child> will be initialized with the new value of a, but not the new value of b. This can be seen here:
Somehow, both right hand observables need to update before stache updates what's in-between {{#if}}. Currently however, stache MUST at least listen for changes in NOTIFY, this is so it can immediately tear down any children.
But I'm not sure stache should be re-evaluating in DERIVE.
I could see re-organizing into the following queues:
notify - stache listens for changes here so it can "teardown" anything old, but doesn't re-evaluate until later.
derive - normal Observation updates here. Two-way bindings update here.
UI - stache re-evaluates here.
DOM - can-view-live applies actual DOM changes here
MUTATE - same as previous
The text was updated successfully, but these errors were encountered:
The problem is with a template like this:
Even if
<export-child>
'sa
andb
change in a batch to truthy values,<import-child>
will be initialized with the new value ofa
, but not the new value ofb
. This can be seen here:https://codepen.io/justinbmeyer/pen/yEGGoK
queues.log()
can explain why:Before
(A)
, all observables created bycan-stache-bindings
are updating.(A)
, the updating of right hand observable ofa:to=this.a
is updated in the DOM_UI queue.{{if(this.a)}}
at(B)
, which renders the<import-child>
component at(C)
.(E)
that the update of the right hand observable ofb:to=this.b
happens.I don't this is expected behavior, but at the same time, I'm not entirely sure how to fix it.
Work around
Only mount the component if you have what you need:
Thoughts on a fix
Somehow, both right hand observables need to update before stache updates what's in-between
{{#if}}
. Currently however, stache MUST at least listen for changes inNOTIFY
, this is so it can immediately tear down any children.But I'm not sure stache should be re-evaluating in
DERIVE
.I could see re-organizing into the following queues:
notify
- stache listens for changes here so it can "teardown" anything old, but doesn't re-evaluate until later.derive
- normal Observation updates here. Two-way bindings update here.UI
- stache re-evaluates here.DOM
- can-view-live applies actual DOM changes hereMUTATE
- same as previousThe text was updated successfully, but these errors were encountered: