This a specialized and optimized version of an AggregateTransientTrait.
Usually, to perform a change detection cycle, we have to:
track all the Transients
check changes on all of them when activity is detected
untrack all of them in case of changes
We may improve this process and increase the performances if we constrain this pipeline:
we track all the Transients until .release() is called
when activity is detected on one of them, we add it to a "MayHaveChanged" list, and we stop tracking it.
later, when we want to detect changes, instead of iterating on all the Transients, we iterate only on the "MayHaveChanged" Transients:
for each of these "MayHaveChanged" Transients:
we remove it from this list (because we will know if it changed or not)
we track again its activity
we check if it changed:
if true, we immediately stop and return true,
else we continue the iteration, and at the end of it we return false, if none of the list changed.
if change have been detected, we may continue with 2, or we may call .release() to stop all of this process (jumping to 1), if we want to track again).
This a specialized and optimized version of an
AggregateTransientTrait
.Usually, to perform a change detection cycle, we have to:
We may improve this process and increase the performances if we constrain this pipeline:
.release()
is calledtrue
,false
, if none of the list changed..release()
to stop all of this process (jumping to 1), if we want to track again).