Remove excess observer calls in Binding::update.
Showing
1 changed file
with
1 additions
and
6 deletions
... | @@ -149,12 +149,7 @@ class Rivets.Binding | ... | @@ -149,12 +149,7 @@ class Rivets.Binding |
149 | # Updates the binding's model from what is currently set on the view. Unbinds | 149 | # Updates the binding's model from what is currently set on the view. Unbinds |
150 | # the old model first and then re-binds with the new model. | 150 | # the old model first and then re-binds with the new model. |
151 | update: (models = {}) => | 151 | update: (models = {}) => |
152 | if models[@rootKey.path] | 152 | @setModel() if models[@rootKey.path] |
153 | @view.adapters[@key.interface].unsubscribe(@model, @key.path, @sync) if @key | ||
154 | @setModel() | ||
155 | @view.adapters[@key.interface].subscribe(@model, @key.path, @sync) if @key | ||
156 | @sync() | ||
157 | |||
158 | @binder.update?.call @, models | 153 | @binder.update?.call @, models |
159 | 154 | ||
160 | # Rivets.ComponentBinding | 155 | # Rivets.ComponentBinding | ... | ... |
-
Please register or sign in to post a comment