On 12/14/16, 10:25 PM, "Yishay Weiss" <[email protected]> wrote:
>
>That was my intent, load it when necessary. My point was that there was
>no reason to attach event handlers when you need the bead, you can just
>check for its existence and load it if necessary.
I just took a look at strandutils. Sure it packages up a common pattern
(check for bead, load bead from values manager), but I'm not understanding
how it would work if called from within the strand setter. For example,
if in MXML, someone did:
<SomeComponent>
<beads>
<SomeBead />
<AnotherBeadThatWorksWIthSomeBead />
I don't think SomeBead can use StrandUtils. The desired partner bead is
about to be added to the strand right after SomeBead as an override for
the default partner bead that would be fetched from ValuesManager. You
could require that overrides have to be before the other partner bead, but
some beads are peers and you can't really specify the order.
I think that's why we recommend using an event. Once all beads are added,
you get an event if you want it, and can get events when beads are added
"later".
-Alex