Closed icm-yairiny closed 10 years ago
Although you can change out components just be reusing add-component
as you have done, this gives you a nice functional alternative. I like it.
Before I can merge this in, I need a test for it please :smile:
Now with unit test :)
Awesome! Looks great. I'll pull it down shortly, test it out and merge it in. Thanks!
This has been merged into the develop branch, and will go out in the next release (which I'm thinking I may do soon).
I'm debating the pros of having the option of returning nil from the fn
to skip changing the component. In theory, you could just return the component instance without any changes, but this way, you could avoid some unneeded processing. What do you think of that idea?
Yeah, that sounds like a good idea. Otherwise, in my original implementation, returning nil would possibly break the data.
Fix for nil is in develop now.
this way, the components themselves can be immutable.