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
It would helpful to be able to iterate through keys of a Map in stache, and have stache do the DOM diffing if a key gets added, removed, or the key's value changes. The order of the keys inserted to the underlying Map(s) would need to be preserved to work in this use case, a Message Log.
For example, I have traceLog Map --> pageName Map--> message Map --> fragments List
I'm looking for a few things here @matthewp does for/of do all these?:
underlying Map retains order of inserted keys so iteration order can be assured in stache (this is likely ok already, but not guaranteed like an ES6 Map)
if a key is added/removed from the Map, or the value for that key is updated, stache should only re-render that diff
access to the current key for that Map, so for (page in traceLog) above would allow me to do {{page}} in the stache. I guess you would have to do {{let value = traceLog[page]}} then to use the value, unless the helper worked like {{for (pageKey, pageValue of traceLog)}} to capture both the key and value for use in the stache.
It would helpful to be able to iterate through keys of a Map in stache, and have stache do the DOM diffing if a key gets added, removed, or the key's value changes. The order of the keys inserted to the underlying Map(s) would need to be preserved to work in this use case, a Message Log.
For example, I have
traceLog Map --> pageName Map--> message Map --> fragments List
data:
stache:
this would likely involve some changes in the way can-view-live handles patches as per discussion with @justinbmeyer
The text was updated successfully, but these errors were encountered: