You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No, this is a bug. We have already an eye on this issue but it's not totally clear what the expected/best behaviour is. Should we call the initialize method on the viewModel or not? There are arguments for both. See issues #343 and #314
We had the plan to fix this inconsitency with 1.4.1 but have decided to delay the fix for more discussion about the desired behaviour.
At the moment I think the best would be to not initialize the viewModel when an existing instance is provided via the FluentViewLoader. The reason for this is that one of the use cases of this method is to reuse ViewModel instances for multiple views. In this case you don't want to re-initialize it multiple times.
This means that we should disable the initialization for the JavaViews in your Example.
What do you think about this? What is your use case?
I'm injecting the view so that I can provide my own scope instance (see issue #355).
If the framework doesn't call it then I need to (just needs to be documented as such). I think it's reasonable to expect that if you are providing the ViewModel instance then you are responsible for initializing it.
Ultimately, the behaviour should be consistent between the two loaders.
The following results in the initialize method being called on the ViewModel:
The initialize method is NOT called for the following:
Is this inconsistency intended?
Thanks
The text was updated successfully, but these errors were encountered: