Frontmatter
| id | 5602 |
| title | model.Component: Improve support for using data records inside VM data properties & binding into record fields |
| state | Closed |
| labels | enhancementstale |
| assignees | [] |
| createdAt | Jul 22, 2024, 9:01 AM |
| updatedAt | Nov 4, 2024, 3:37 AM |
| githubUrl | https://github.com/neomjs/neo/issues/5602 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Nov 4, 2024, 3:37 AM |
VMs have a safeguard to not change the internal structure of records: https://github.com/neomjs/neo/blob/dev/src/model/Component.mjs#L518
Normally, each object property would get replaced with setters to get change events, but this could easily break the internal logic of records, which is also get & set driven.
if we wanted to bind to specific record fields, we would need to extend the logic a bit: e.g. somewhere here: https://github.com/neomjs/neo/blob/dev/src/data/RecordFactory.mjs#L329
records do fire change events on their store, but we would need a notification for a given VM which then could trigger
onDataPropertyChange().