Open tja4472 opened 7 years ago
On reflection it would be best to leave internal-list-observable.ts alone.
emulate-list.ts - processEmulation will then be
const aa_newValue = { ...this.observableValue[itemToUpdateIndex], ...value };
console.log('aa_newValue>', aa_newValue);
const bb_newValue = unwrap(key, aa_newValue, () => aa_newValue !== null);
console.log('bb_newValue>', bb_newValue);
this.observableValue[itemToUpdateIndex] = bb_newValue;
I'm facing an issue:
I have a list of elements, where each element is like:
{ property1: "this is one", property2: "this is two" }
When I do
this.db.list('/elements').update(elementId, {property1: "this is NEW one"});
property1 is updated, but property2 is DELETED, just like a SET instead of an UPDATE.
Is this the problem you are describing above?
Yes, I'm afraid so.
Hello again
Online update allows for the update of individual properties.
Offline: Just the updated property is returned.
Proposed fix
emulate-list.ts - processEmulation
internal-list-observable.ts
hth Tim