flux-crud-store
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -89,11 +89,9 @@ 'use strict'; | ||
_cacheViewModel: function (model) { | ||
var cachedViewModel = this._viewModels.get(model.cid); | ||
var viewModel; | ||
if (cachedViewModel) { | ||
viewModel = cachedViewModel.merge(model.attributes); | ||
} else { | ||
viewModel = new this.viewModel(model.attributes); | ||
var existingViewModel = this._viewModels.get(model.cid); | ||
if (!existingViewModel) { | ||
existingViewModel = new this.viewModel(); | ||
} | ||
var viewModel = existingViewModel.merge(model.attributes); | ||
this._viewModels = this._viewModels.set(model.cid, viewModel); | ||
@@ -100,0 +98,0 @@ return viewModel; |
@@ -6,3 +6,3 @@ { | ||
"author": "Holman Gao <holman@golmansax.com>", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "lib/index.js", | ||
@@ -41,4 +41,5 @@ "repository": { | ||
"scripts": { | ||
"test": "make test" | ||
"test": "make test", | ||
"build": "make build" | ||
} | ||
} |
8934
204