Comparing version 0.1.23 to 0.1.24
@@ -91,8 +91,3 @@ 'use strict'; | ||
set: function set(value) { | ||
var _payload; | ||
ModelClass.addUpdate({ | ||
type: _constants.UPDATE, | ||
payload: (_payload = {}, _defineProperty(_payload, idAttribute, _this.getId()), _defineProperty(_payload, fieldName, value), _payload) | ||
}); | ||
return _this.set(fieldName, value); | ||
} | ||
@@ -99,0 +94,0 @@ }); |
@@ -90,2 +90,19 @@ 'use strict'; | ||
}); | ||
it('correctly sets field value on assignment', function () { | ||
schema.register(Person, Location); | ||
var session = schema.from(schema.getDefaultState()); | ||
Person.create({ id: 0, name: 'Tommi', friend: null }); | ||
var nextState = session.reduce(); | ||
var nextSession = schema.from(nextState); | ||
var newName = 'NewName'; | ||
nextSession.Person.withId(0).name = newName; | ||
var nextNextState = session.reduce(); | ||
var nextNextSession = schema.from(nextNextState); | ||
(0, _chai.expect)(nextNextSession.Person.withId(0).name).to.equal(newName); | ||
}); | ||
}); | ||
@@ -92,0 +109,0 @@ |
{ | ||
"name": "redux-orm", | ||
"version": "0.1.23", | ||
"version": "0.1.24", | ||
"description": "Simple ORM to manage and query your state trees", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -57,11 +57,3 @@ import forOwn from 'lodash/object/forOwn'; | ||
get: () => fieldValue, | ||
set: (value) => { | ||
ModelClass.addUpdate({ | ||
type: UPDATE, | ||
payload: { | ||
[idAttribute]: this.getId(), | ||
[fieldName]: value, | ||
}, | ||
}); | ||
}, | ||
set: (value) => this.set(fieldName, value), | ||
}); | ||
@@ -68,0 +60,0 @@ } |
@@ -48,2 +48,19 @@ import {expect} from 'chai'; | ||
}); | ||
it('correctly sets field value on assignment', () => { | ||
schema.register(Person, Location); | ||
const session = schema.from(schema.getDefaultState()); | ||
Person.create({id: 0, name: 'Tommi', friend: null}); | ||
const nextState = session.reduce(); | ||
const nextSession = schema.from(nextState); | ||
const newName = 'NewName'; | ||
nextSession.Person.withId(0).name = newName; | ||
const nextNextState = session.reduce(); | ||
const nextNextSession = schema.from(nextNextState); | ||
expect(nextNextSession.Person.withId(0).name).to.equal(newName); | ||
}); | ||
}); | ||
@@ -50,0 +67,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1549000
6531