Comparing version 0.6.11 to 0.6.12
{ | ||
"name": "imvvm", | ||
"version": "0.6.11", | ||
"version": "0.6.12", | ||
"homepage": "https://github.com/entrendipity/imvvm", | ||
@@ -16,9 +16,9 @@ "authors": [ | ||
"keywords": [ | ||
"imvvm", | ||
"mvvm", | ||
"mvc", | ||
"react", | ||
"mvc", | ||
"mvvm", | ||
"immutable", | ||
"node", | ||
"immutable", | ||
"presentation model" | ||
"presentation model", | ||
"imvvm" | ||
], | ||
@@ -25,0 +25,0 @@ "license": "MIT", |
@@ -20,3 +20,3 @@ var fs = require('fs'); | ||
if(err) { | ||
console.log(err); | ||
console.error(err); | ||
} else { | ||
@@ -23,0 +23,0 @@ console.log("Files saved!"); |
@@ -113,3 +113,3 @@ /*jshint unused: false */ | ||
var age = Math.abs(ageDate.getFullYear() - 1970); | ||
return Number.isNaN(age) ? 'Enter your Birthday' : age + ' years old'; | ||
return isNaN(age) ? 'Enter your Birthday' : age + ' years old'; | ||
}, | ||
@@ -134,6 +134,9 @@ | ||
var arr; | ||
if(this.hobbies.indexOf(value) === -1){ | ||
arr = this.hobbies.slice(0); | ||
this.hobbies = arr.concat(value); | ||
} | ||
for (var i = this.hobbies.length - 1; i >= 0; i--) { | ||
if(this.hobbies[i].name === value.name){ | ||
return; | ||
} | ||
}; | ||
arr = this.hobbies.slice(0); | ||
this.hobbies = arr.concat(value); | ||
}, | ||
@@ -145,3 +148,2 @@ | ||
}); | ||
console.log(this.hobbies); | ||
}, | ||
@@ -148,0 +150,0 @@ |
@@ -92,4 +92,6 @@ /*jshint unused: false */ | ||
addHobby: function(value){ | ||
this.state.personsContext.selectedPerson. | ||
addHobby(this.Hobby({ id:this.uuid(), name:value }, true)); | ||
if(value !== ''){ | ||
this.state.personsContext.selectedPerson. | ||
addHobby(this.Hobby({ id:this.uuid(), name:value }, true)); | ||
} | ||
}, | ||
@@ -96,0 +98,0 @@ |
{ | ||
"name": "imvvm", | ||
"description": "Immutable MVVM for React", | ||
"version": "0.6.11", | ||
"version": "0.6.12", | ||
"keywords": [ | ||
"imvvm", | ||
"react", | ||
"mvvm", | ||
"mvc", | ||
"react", | ||
"immutable", | ||
"node", | ||
"presentation model" | ||
"presentation model", | ||
"imvvm" | ||
], | ||
@@ -29,2 +29,2 @@ "homepage": "https://github.com/entrendipity/imvvm", | ||
} | ||
} | ||
} |
@@ -268,3 +268,3 @@ IMVVM | ||
#####imOnline | ||
The `imOnline` field is referencing the linked DomainModel field `online` with an alias of `imOnline`. It simply forwards the online value it recieves from the DomainViewModel to the View and has no influence over its output. It is for this reason that the field descriptor has a `kind` decorator of `pseudo`. Fields that obtain their value from other sources and have no influence on the output value, should be flagged with the decorator `kind:'pseudo'`, unless it is a calculated field, a `kind:'instance'` field or a `kind:'array'`. | ||
The `imOnline` field is referencing the linked DomainModel field `online` with an alias of `imOnline`. It simply forwards the online value it recieves from the DomainViewModel to the View and has no influence over its output. It is for this reason that the field descriptor has a `kind` decorator of `pseudo`. Fields that obtain their value from other sources and have no influence on the output value, should be flagged with the decorator `kind:'pseudo'`. | ||
#####selectedPerson | ||
@@ -645,2 +645,3 @@ `selectedPerson` is another field that has a `kind` decorator. The `selectedPerson` field is of kind `instance`. Which simply means that it will return a model instance. | ||
`true` - can transition to previous state. | ||
`false` - can not transition to previous state. | ||
@@ -653,2 +654,3 @@ | ||
`true` - can revert back to next state. | ||
`false` - can not revert back to next state. | ||
@@ -783,2 +785,10 @@ | ||
___n.b. Only use stateChangedHandlers in ViewModels. Do not use stateChangedHandlers in Models. You can still use Model within Models. Below is an example of how you would initialize Model instances inside other Models.___ | ||
```javascript | ||
Hobby: function(hobbyState, init){ | ||
return new HobbyModel()(hobbyState, init); | ||
}, | ||
``` | ||
__nextState__ | ||
@@ -796,3 +806,3 @@ | ||
__n.b. This is suggested usage and not part of the API__ | ||
___n.b. This is suggested usage and not part of the API___ | ||
@@ -799,0 +809,0 @@ ######ModelInstance ModelFactory(object nextState[, boolean initialize:false]) |
166205
2494
923