canjs / can-view-scope

Scope management for view engines
https://canjs.com/doc/can-view-scope.html
MIT License
4 stars 0 forks source link

support a warnOnMissingKey property and temp binding on scopeKey #196

Closed justinbmeyer closed 5 years ago

justinbmeyer commented 5 years ago

This supports lazy reading of values. This is needed to make something like {{# and(this.first, this.second) }} not actually read this.second if this.first is false.

This makes scopeKeyData.initialValue bind if the observable is not already bound.

This is going to be used by https://github.com/canjs/can-stache/pull/632, which will only look at initialValue if it absolutely needs to. If initialValue is read, then the binding will happen.

Ideally, initialValue would not need to be looked at. We would wait until everything is built out and can-view-live binds, but there are places like figuring out if a function or not where this is necessary.