Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't emit change events if first initialized

  • Loading branch information...
commit a827cd4ad24fd537cbc9439325c4f05cf1e11f94 1 parent 1da43ed
@MatthewMueller MatthewMueller authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  lib/index.js
View
3  lib/index.js
@@ -34,9 +34,8 @@ function createModel(name) {
function model(attrs) {
if (!(this instanceof model)) return new model(attrs);
this._callbacks = {};
- this.attrs = {};
+ this.attrs = attrs || {};
this.dirty = {};
- if (attrs) this.set(attrs);

This makes it less straight-forward to implement a plugin for supporting nested models, since it's no longer enough to monkey patch model.prototype.set into doing the appropriate constructor invocations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
}
// mixin emitte
@karlbohlmark

This makes it less straight-forward to implement a plugin for supporting nested models, since it's no longer enough to monkey patch model.prototype.set into doing the appropriate constructor invocations.

Please sign in to comment.
Something went wrong with that request. Please try again.