_StoreMixin.js
// function called within loop to generate a function for putting an item
function called within loop to generate a function for putting an item
function called within loop to generate a function for putting an item
function putter(id, dirtyObj) {
				return function (object) {
					var colsWithSet = self._columnsWithSet,
						updating = self._updating,
						key, data;
					if (typeof object.set === 'function') {
						object.set(dirtyObj);
					} else {
						for (key in dirtyObj) {
							object[key] = dirtyObj[key];
						}
					}
					for (key in colsWithSet) {
						data = colsWithSet[key].set(object);
						if (data !== undefined) {
							object[key] = data;
						}
					}
					updating[id] = true;
					return when(store.put(object), function () {
						delete dirty[id];
						delete updating[id];
					});
				};
			}
function putter ( id , dirtyObj ) { return function ( object ) { var colsWithSet = self . _columnsWithSet , updating = self . _updating , key , data ; if ( typeof object . set === 'function' ) { object . set ( dirtyObj ) ; } else { for ( key in dirtyObj ) { object [ key ] = dirtyObj [ key ] ; } } for ( key in colsWithSet ) { data = colsWithSet [ key ] . set ( object ) ; if ( data !== undefined ) { object [ key ] = data ; } } updating [ id ] = true ; return when ( store . put ( object ) , function ( ) { delete dirty [ id ] ; delete updating [ id ] ; } ) ; } ; }
function called within loop to generate a function for putting an item
function called within loop to generate a function for putting an item
// Return a function handler // Copy dirty props to the original, applying setters if applicable // Apply any set methods in column definitions. // Note that while in the most common cases column.set is intended // to return transformed data for the key in question, it is also // possible to directly modify the object to be saved. // Put it in the store, returning the result/promise // Clear the item now that it's been confirmed updated