does the sync field detects an item pushed into an array?
Hi Saad,
For the syncField to recognize changes in an array, you need to reassign the whole array to trigger an update. Specifically, when you push an item into an array, the system does not automatically detect this change unless you explicitly reassign the field.
For example, if you have an array field decorated with @syncField()
, after you push a new item into it, you should do something like:
this.myArray.push(newItem);
this.myArray = this.myArray; // This will notify the syncField
This reassigns the array, so the sync system detects the change properly (see the documentation).
If you have any further questions or need clarification on how to implement this, feel free to ask!
3 replies left
thread_Z0RRNV6SK0iSfQaGZV2xzzAL
Reply to this message to continue the conversation
This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.