Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-simple-store

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-simple-store - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

tmp/.metadata_never_index

24

addon/model.js

@@ -33,9 +33,9 @@ import Ember from "ember";

if (arguments.length === 2) {
if (!this.get("isDirty")) {
if (!this.get("isDirty") && !this.get("isPrimed")) {
var oldState = clone(this);
this.set("_oldState", oldState);
}
var primed = value === "" && !data[key];
var primed = value === "" && data[key] === undefined;
if(!primed) {
this.set("isDirty", true);
this.set("isPrimed", true);
dirty["%@:isDirty".fmt(key)] = true;

@@ -68,3 +68,3 @@ data[key] = value;

_reset: function() {
this.set("isDirty", false);
this.set("isPrimed", false);
this.set("_dirty", {});

@@ -74,3 +74,4 @@ },

var self = this;
attrs(this).forEach(function(attrName) {
var attributes = attrs(this);
attributes.forEach(function(attrName) {
var dynamicKey = "%@IsDirty".fmt(attrName);

@@ -82,5 +83,16 @@ Ember.defineProperty(self, dynamicKey, Ember.computed(function() {

var dirtyKey = "%@:isDirty".fmt(attrName);
return original === current ? undefined : dirty[dirtyKey];
var dirtyCheck = (original === current) || (original === undefined && current === "");
return dirtyCheck ? undefined : dirty[dirtyKey];
}).property("_dirty", "" + attrName));
});
var modelIsDirtyAttrs = [];
attributes.forEach(function(attr) {
modelIsDirtyAttrs.push(attr + "IsDirty");
});
Ember.defineProperty(this, "isDirty", Ember.computed(function() {
var modelAttrs = modelIsDirtyAttrs.filter(function(attr){
return self.get(attr) === true;
});
return modelAttrs.length > 0;
}).property("" + modelIsDirtyAttrs));
}

@@ -87,0 +99,0 @@ });

{
"name": "ember-cli-simple-store",
"version": "0.9.0",
"version": "0.9.1",
"description": "ember-cli addon that provides a simple identity map for ember.js web applications",

@@ -5,0 +5,0 @@ "directories": {

# ember-cli-simple-store
[![Build Status][]](https://travis-ci.org/toranb/ember-cli-simple-store)
[![Downloads](https://img.shields.io/npm/dm/ember-cli-simple-store.svg)](https://www.npmjs.com/package/ember-cli-simple-store)
[![Score](http://emberobserver.com/badges/ember-cli-simple-store.svg)](http://emberobserver.com/addons/ember-cli-simple-store)

@@ -5,0 +7,0 @@ ## Description

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