Frontmatter
| id | 1707 |
| title | worker.App: isUsingViewModels config |
| state | Closed |
| labels | enhancement |
| assignees | tobiu |
| createdAt | Apr 1, 2021, 5:07 PM |
| updatedAt | Apr 1, 2021, 5:08 PM |
| githubUrl | https://github.com/neomjs/neo/issues/1707 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 1, 2021, 5:08 PM |
since now every component will trigger
getModel(), it will parse up to the full parent component chain to find the closest view model.this can be expensive, especially in case there are no view models at all.
since view models are supposed to be optional, we need to store a flag inside
worker.Appwhich defaults to false.the
model.Componentctor will set it to true.component.Base: getModel()can then check for the flag and return null in case it equals false.my first idea was to add the flag to
controller.Application(apps), but this will cause issues in case you dynamically move a component tree from one app to another.