$dispose in a component cannot update bindings#150
Conversation
|
I have opened this pull request because it seemed to fit the use case from @pgrab, but after thinking a bit, I am not convinced at all it is a good thing to update the data model in the Let's consider the following template: With this template, let's say we have @b-laporte @pgrab What do you think? So should I simply close this pull request? |
|
I'm fine with your first proposal of still having the observer working when you're inside the dispose method. The drawback you raise into your comment is also true, but it's more about a design issue of the application using the framework than the framework itself. In my case I'm using a third party component that is editable, so basically I have to connect manually the data from the hashspace model to it. And since it's in one tab when I switch and switch back not having the capacity to update the hashspace model inside the dispose method leads me to loose the data. The other way to do it would be to update the hashspace model at each change into the component itself, which is not necessary in my case and is an assumption on the third party component to be able to manage this kind of interaction that is not necessary. So I'm fine with the change (and it works for me ;-) ). |
This pull request fixes an issue raised by @pgrab: it is not possible to update bindings from the
$disposemethod in a component, because the observer is removed before calling$dispose.Before integrating this pull request, I still have to: