When an object is observed and I try to change the entire object the data-binds of inner properties still linked with ux components…
I think in this way the best behavior is clean all the old data-binds… because all the object was changed… We can see this behavior in all frameworks on the market like Angular 1/2
, React
, NativeScript
and I think on the major frameworks works the same.
Follow a sample:
<App Background="#000">
<JavaScript>
var Observable = require("FuseJS/Observable");
var test = Observable({a:'im A', b:'im B'});
var change = function(){
test.value ={a:'im the new A'};
}
module.exports = {
change: change,
test: test
}
</JavaScript>
<StackPanel Color="White">
<Text Value="{test.a}"/>
<Text Value="{test.b}"/>
<Button Text="Change pls" Clicked="{change}"/>
</StackPanel>
</App>
What you guys think about it?
sry about my english