New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

imvvm

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imvvm - npm Package Compare versions

Comparing version 0.3.0-alpha to 0.3.1-alpha

2

bower.json
{
"name": "imvvm",
"version": "0.3.0-alpha",
"version": "0.3.1-alpha",
"homepage": "https://github.com/entrendipity/imvvm",

@@ -5,0 +5,0 @@ "authors": [

@@ -0,1 +1,2 @@

/*jshint unused: false */
/* global AppViewModel, PersonsViewModel, HobbiesViewModel */

@@ -2,0 +3,0 @@

@@ -1,2 +0,1 @@

/**

@@ -3,0 +2,0 @@ * @jsx React.DOM

@@ -1,2 +0,3 @@

/*jshint unused: vars */
/*jshint unused: false */
/* global IMVVM */

@@ -8,7 +9,7 @@

getInitialState: function(nextState, prevState){ //Optional
return {
getInitialState: function(nextState, prevState){ //Optional
return {
online: typeof nextState.online === 'boolean' ? nextState.online : false,
busy: nextState.busy === void(0) ? false : nextState.busy
}
};
},

@@ -15,0 +16,0 @@

@@ -1,2 +0,2 @@

/*jshint unused: false */
/* global IMVVM */

@@ -40,7 +40,8 @@

var ageDate = new Date(Date.now() - DOB.getTime()); // miliseconds from epoch
return Math.abs(ageDate.getFullYear() - 1970) + " years old";
return Math.abs(ageDate.getFullYear() - 1970) + ' years old';
},
getInitialState: function(nextState/*, prevState*/){
return {
getInitialState: function(nextState, prevState){
console.log(prevState);
return {
id: nextState.id ? nextState.id : this.uuid(),

@@ -77,14 +78,14 @@ age: this.calculateAge(nextState.dob),

enumerable: false, //calculated fields should set enumerable to false
get: function(){
get: function(){
if(this.lastName === void(0)){
return this.firstName;
}
return this.firstName + " " + this.lastName;
return this.firstName + ' ' + this.lastName;
},
set: function(newValue){
var nextState = {};
var nameArr = newValue.split(" ");
var isSpace = newValue.slice(-1)[0] === " ";
var nameArr = newValue.split(' ');
var isSpace = newValue.slice(-1)[0] === ' ';
var firstname = nameArr[0];
var lastname = nameArr.slice(1).join(" ");
var lastname = nameArr.slice(1).join(' ');

@@ -91,0 +92,0 @@ nextState.firstName = firstname.length === 0 ? void(0) : firstname;

@@ -1,2 +0,2 @@

/*jshint camelcase:false */
/*jshint unused: false */
/* global IMVVM */

@@ -7,40 +7,41 @@

var HobbiesViewModel = IMVVM.createViewModel({
select: function(value){
var nextState = {};
nextState.selected = this.persons$selected.hobbies.filter(function(hobby){
return hobby === value;
})[0];
this.setState(nextState);
},
addHobby: function(value){
this.persons$selected.addHobby(value);
},
deleteHobby: function(value){
this.persons$selected.deleteHobby(value);
},
select: function(value){
var nextState = {};
nextState.selected = this.persons$selected.hobbies.filter(function(hobby){
return hobby === value;
})[0];
this.setState(nextState);
},
addHobby: function(value){
this.persons$selected.addHobby(value);
},
deleteHobby: function(value){
this.persons$selected.deleteHobby(value);
},
//When a dependency changes reset the selected hobby to undefined
resetSelected: function(nextState, prevState) {
//When a dependency changes reset the selected hobby to undefined
resetSelected: function(nextState, prevState) {
if(prevState.persons$selected && nextState.persons$selected){
if(nextState.persons$selected.id !== prevState.persons$selected.id &&
nextState.selected !== void(0)){
return void(0);
}
nextState.selected !== void(0)){
return void(0);
}
}
return nextState.selected;
return nextState.selected;
},
getInitialState: function(nextState, prevState){
return {
getInitialState: function(nextState, prevState){
return {
selected: this.resetSelected(nextState, prevState),
appIsBusy: nextState.appIsBusy === void(0) ? false : nextState.appIsBusy
};
},
selected: {
get: function(){
return this.state.selected;
}
},
selected: {
get: function(){
return this.state.selected;
}
},
},
});

@@ -1,3 +0,3 @@

/*jshint camelcase:false */
/* global IMVVM */
/*jshint unused: false */
/* global IMVVM, DataService, PersonModel */

@@ -26,3 +26,3 @@ 'use strict';

if(value && value.length > 0){
name = value.split(" ");
name = value.split(' ');
//Cannot initialize by passing in calculated prop value

@@ -32,3 +32,3 @@ //i.e. fullname

firstName: name[0],
lastName: name.slice(1).join(" ")
lastName: name.slice(1).join(' ')
});

@@ -73,3 +73,3 @@ nextState.collection = this.collection.slice(0);

if(person.id === prevState.id){
persons.selected = this.Person(nextState);
persons.selected = this.Person(nextState, person);
return persons.selected;

@@ -76,0 +76,0 @@ }

{
"name": "imvvm",
"description": "Immutable MVVM for React",
"version": "0.3.0-alpha",
"version": "0.3.1-alpha",
"keywords": [

@@ -6,0 +6,0 @@ "imvvm",

@@ -38,2 +38,4 @@

}
} else {
prevState = ('state' in prevState) ? prevState.state : prevState;
}

@@ -40,0 +42,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc