@@ -703,12 +703,19 @@ component output="true" {
703
703
// Set our component's id to the incoming memo id
704
704
variables ._id = arguments .componentPayload .snapshot .memo .id ;
705
705
// Append the incoming data to our component's data
706
+ // It important that we run through all the incoming snapshot
707
+ // data and set it to our component's data before calling
708
+ // the onHydrate events.
706
709
arguments .componentPayload .snapshot .data .each ( function ( key , value ) {
707
- variables .data [ key ] = value ;
708
- if ( structKeyExists ( this , " onHydrate#key #" ) ) {
709
- invoke ( this , " onHydrate#key #" , { value : value });
710
- }
710
+ variables .data [ arguments .key ] = arguments .value ;
711
+ } );
712
+ // Run onHydrateProperty events
713
+ arguments .componentPayload .snapshot .data .filter ( function ( key , value ) {
714
+ return structKeyExists ( this , " onHydrate#arguments .key #" );
715
+ } ).each ( function ( key , value ) {
716
+ invoke ( this , " onHydrate#arguments .key #" );
711
717
} );
718
+
712
719
// Run onHydrate if it exists
713
720
if ( structKeyExists ( this , " onHydrate" ) ) {
714
721
invoke ( this , " onHydrate" , { incomingPayload : arguments .componentPayload .snapshot .data } );
0 commit comments