Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
factor out bind recording
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Apr 25, 2014
1 parent d52a288 commit 6dc0819
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/instance/mdv.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
// tooling. It has a performance cost so it's opt-in in Node.bind.
if (Platform.enableBindingsReflection && observer) {
observer.path = observable.path_;
this.bindings_ = this.bindings_ || {};
this.bindings_[property] = observer;
this._recordBinding(property, observer);
}
if (this.reflect[property]) {
this.reflectPropertyToAttribute(property);
Expand All @@ -44,6 +43,10 @@
bindFinished: function() {
this.makeElementReady();
},
_recordBinding: function(name, observer) {
this.bindings_ = this.bindings_ || {};
this.bindings_[name] = observer;
},
// TODO(sorvell): unbind/unbindAll has been removed, as public api, from
// TemplateBinding. We still need to close/dispose of observers but perhaps
// we should choose a more explicit name.
Expand Down

0 comments on commit 6dc0819

Please sign in to comment.