@@ -340,8 +340,8 @@ private extension StoreContext {
340340 ) {
341341 store. state. caches [ key] = AtomCache ( atom: atom, value: newValue)
342342
343- // Check if the atom should propagate the update to downstream .
344- guard atom. _loader. shouldPropagateUpdate ( newValue: newValue, oldValue: oldValue) else {
343+ // Check whether if the dependent atoms should be updated transitively .
344+ guard atom. _loader. shouldUpdateTransitively ( newValue: newValue, oldValue: oldValue) else {
345345 return
346346 }
347347
@@ -351,7 +351,7 @@ private extension StoreContext {
351351 atom. updated ( newValue: newValue, oldValue: oldValue, context: context)
352352
353353 // Calculate topological order for updating downstream efficiently.
354- let ( edges, omitted ) = topologicalSort ( key: key, store: store)
354+ let ( edges, redundant ) = topologicalSort ( key: key, store: store)
355355 var skippingFrom = Set < AtomKey > ( )
356356
357357 // Updates the given atom.
@@ -364,8 +364,8 @@ private extension StoreContext {
364364 let override = lookupOverride ( of: atom)
365365 let newCache = makeCache ( of: atom, for: key, override: override)
366366
367- // Skip if the atom should not propagate update to downstream .
368- guard atom. _loader. shouldPropagateUpdate ( newValue: newCache. value, oldValue: cache. value) else {
367+ // Check whether if the dependent atoms should be updated transitively .
368+ guard atom. _loader. shouldUpdateTransitively ( newValue: newCache. value, oldValue: cache. value) else {
369369 // Record the atom to avoid downstream from being update.
370370 skippingFrom. insert ( key)
371371 return
@@ -379,14 +379,14 @@ private extension StoreContext {
379379
380380 // Performs update of the given atom with the parent's context.
381381 func performUpdate( atom: some Atom , for key: AtomKey , dependency: some Atom ) {
382- dependency. _loader. performPropagativeUpdate {
382+ dependency. _loader. performTransitiveUpdate {
383383 update ( atom: atom, for: key)
384384 }
385385 }
386386
387387 // Performs update of the given subscription with the parent's context.
388388 func performUpdate( subscription: Subscription , dependency: some Atom ) {
389- dependency. _loader. performPropagativeUpdate ( subscription. update)
389+ dependency. _loader. performTransitiveUpdate ( subscription. update)
390390 }
391391
392392 // Do not transitively update atoms that have parent recorded not to update downstream.
@@ -397,24 +397,24 @@ private extension StoreContext {
397397 return edge
398398 }
399399
400- guard let omittedFrom = omitted [ edge. to] else {
400+ guard let redundantFrom = redundant [ edge. to] else {
401401 return nil
402402 }
403403
404- guard let fromKey = omittedFrom . subtracting ( skippingFrom) . first else {
404+ guard let fromKey = redundantFrom . subtracting ( skippingFrom) . first else {
405405 return nil
406406 }
407407
408- // Switch atom update transaction context (e.g. animation) to a non-skipped one on
409- // a best-effort basis.
410- // Topological sorting itself does not always produce an idempotent result when multiple
408+ // Convert edge's `from`, which represents a dependent atom, to a non-skipped one on
409+ // a best-effort basis to switch the update transaction context (e.g. animation) .
410+ // Topological sorting itself does not guarantee idempotent result when multiple
411411 // dependencies of an atom update simultaneously and there's no valid update order rule to
412412 // determine which atom produced the transitive update, and thus here chooses a random
413- // dependent atom from omitted ones .
413+ // dependent atom from redundant edges .
414414 return Edge ( from: fromKey, to: edge. to)
415415 }
416416
417- // Performs atom updates ahead of notifying updates to subscriptions.
417+ // Performs transitive update for dependent atoms s ahead of notifying updates to subscriptions.
418418 for edge in edges {
419419 switch edge. to {
420420 case . atom( let key) :
0 commit comments