(eventType, data) { if (data.crud) { data.crud.forEach(function (crudItem) { if (crudItem.type === ‘update’) { // look up our model in memory var model = app.getModel(crudItem.object, crudItem.id); // if we find it, set our data if (model) model.set(crudItem.data); } else if (crudItem.type === ‘create’) { // create it and add it } else if (crudItem.type === ‘delete’) { // find it and delete it if found } }); } }); Wednesday, October 24, 12