Closed miguelcobain closed 10 years ago
Yes this is most likely having to do with isDirty
being volatile. The reason for this is that dirtiness is somewhat expensive to compute (as the properties could change back to their original values and not be dirty anymore). I think there is still a solution here, however. Let me think about this.
It may be expensive, but remember:
Correctness is paramount. All other features, including performance, are important, but secondary.
:)
Just kidding. Of course we need to make a good balance between both things. This is a very useful feature.
How does ED tackle this?
Meanwhile we can cyclically check the isDirty property with an interval. But that's such a dirty hack...
I just ran into exactly this problem myself. For now I'm just going to hack together my own isDirty
on the controller because I kind of need it.
I just checked in a commit to make model.isDirty
no longer volatile. This should fix your issue (let me know if it doesn't). I also added session.isDirty
.
I'm having some trouble with the
isDirty
flag.When I used ED I used to have a conditional check in my templates that depended on
isDirty
. Something like:As soon as I changed any property in the model, this conditional block would get immediatly rendered. But with EPF this doesn't happen.
isDirty
seems to change its value, but the observers don't fire. For debugging I dropped an observer in my model like:But this never gets executed. Does this have anything to do with the
isDirty
computed property being volatile? What is happening?Thanks!