ripplejs / ripple

A tiny foundation for building reactive views
http://ripplejs.github.io
1.28k stars 66 forks source link

Clone, not use link to object when pass it to model #27

Closed dmfilipenko closed 10 years ago

dmfilipenko commented 10 years ago

I found this behaviour when we pass data to model in such way http://jsfiddle.net/4j5ZD/11/ and then change model we are change basic object

anthonyshort commented 10 years ago

I actually wanted this to be how it worked since it will eventually use Object.observe. Then in this case you could do user.name = 'Barry' and it would update both views.

I think it might be best to leave it to the user to clone it if they really want different values. Unless this is presenting some pretty annoying bugs in practice.