LearnNewsExamplesServices
Frontmatter
id1707
titleworker.App: isUsingViewModels config
stateClosed
labels
enhancement
assigneestobiu
createdAtApr 1, 2021, 5:07 PM
updatedAtApr 1, 2021, 5:08 PM
githubUrlhttps://github.com/neomjs/neo/issues/1707
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 1, 2021, 5:08 PM

worker.App: isUsingViewModels config

Closed v8.1.0 enhancement
tobiu
tobiu commented on Apr 1, 2021, 5:07 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.App which defaults to false.

the model.Component ctor 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.

tobiu added the enhancement label on Apr 1, 2021, 5:07 PM
tobiu assigned to @tobiu on Apr 1, 2021, 5:07 PM
tobiu referenced in commit feb5bae - "worker.App: isUsingViewModels config #1707" on Apr 1, 2021, 5:08 PM
tobiu closed this issue on Apr 1, 2021, 5:08 PM