On 1/3/17, 10:17 PM, "yishayw" <yishayj...@hotmail.com> wrote:
> >I'm not sure how this would work. I assume ConditionalBead is added to the >strand and stays there, listening to changes in data.twitter. Now suppose >data.twitter goes from null to non-null. What's supposed to happen? How is >the button state changed to enabled? Simply calling removeBead won't >automatically do it. Now, what happens when data.twitter goes back to >null? >Are you suggesting to keep Disabled as a member of ConditionalBead? If so, >it doesn't look like we've saved any memory and we could have just as well >put the binding condition on the Disabled bead. > >What am I missing? You aren't missing anything. DisabledBead should continue to have a flag. It will be more efficient to work with that way. But in the general case, this is a fun exercise to see what is possible. We might need to make sure removeBead sets strand to null on the removed bead and beads that support conditional removal would have to know to clean up if strand was non-null and is going to null. Thanks, -Alex