Comparing version 0.6.2 to 0.6.3
{ | ||
"name": "imvvm", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"homepage": "https://github.com/entrendipity/imvvm", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -11,3 +11,3 @@ /*jshint unused: false */ | ||
return this.state.id; | ||
} | ||
} | ||
}, | ||
@@ -14,0 +14,0 @@ |
/*jshint unused: false */ | ||
/* global IMVVM */ | ||
/* global IMVVM, DataService, HobbyModel */ | ||
@@ -4,0 +4,0 @@ 'use strict'; |
/*jshint unused: false */ | ||
/* global IMVVM */ | ||
/* global IMVVM, HobbyModel */ | ||
@@ -19,3 +19,3 @@ 'use strict'; | ||
} | ||
} | ||
}; | ||
}, | ||
@@ -58,3 +58,3 @@ | ||
var newState = {}; | ||
var newState = {}; | ||
var hobbiesArr = this.hobbies.map(function(hobby){ | ||
@@ -66,7 +66,7 @@ if (hobby.id === nextState.id){ | ||
} | ||
return hobby; | ||
return hobby; | ||
}.bind(this)); | ||
this.setState(newState, function(){ | ||
this.state.personsContext.selectedPerson.hobbies = hobbiesArr; | ||
this.state.personsContext.selectedPerson.hobbies = hobbiesArr; | ||
}.bind(this)); | ||
@@ -91,3 +91,3 @@ | ||
} | ||
}; | ||
} | ||
}, | ||
@@ -94,0 +94,0 @@ |
@@ -28,3 +28,3 @@ /*jshint unused: false */ | ||
} | ||
} | ||
}; | ||
}, | ||
@@ -59,3 +59,3 @@ | ||
get: function() { | ||
return this.state.hobbiesContext.current ? this.state.hobbiesContext.current.name: void(0); | ||
return this.state.hobbiesContext.current ? this.state.hobbiesContext.current.name: void(0); | ||
} | ||
@@ -80,3 +80,3 @@ }, | ||
} | ||
}; | ||
} | ||
}, | ||
@@ -83,0 +83,0 @@ |
{ | ||
"name": "imvvm", | ||
"description": "Immutable MVVM for React", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "imvvm", |
@@ -173,3 +173,3 @@ IMVVM | ||
} | ||
} | ||
}; | ||
}, | ||
@@ -224,3 +224,3 @@ | ||
} | ||
}; | ||
} | ||
}, | ||
@@ -306,3 +306,3 @@ | ||
} | ||
} | ||
}; | ||
}, | ||
@@ -334,3 +334,3 @@ | ||
} | ||
}; | ||
} | ||
}, | ||
@@ -352,3 +352,3 @@ | ||
For instance `this.setState({current: this.Hobby(this.hobbies[i])}, {busy: true});`. The first parameter is the next state for `hobbies` data context, the second parameter specifies that `busy`, in the domain data context shold be changed to `true`. This second parameter also accepts `{persons: {selectedPerson: this.Person(personState)}}`. | ||
For instance `this.setState({current: this.Hobby(this.hobbies[i])}, {busy: true});`. The first parameter is the next state for `hobbies` data context, the second parameter specifies that `busy`, in the domain data context should be changed to `true`. This second parameter also accepts, for example, `{persons: {selectedPerson: this.Person(personState)}}`. | ||
@@ -355,0 +355,0 @@ Also noted in the comments is that this can be achieved with a callback, ensuring to pass `void(0)` as the first parameter to `setState`. |
158120