Skip to content

Function: affectedBy() ​

ts
function affectedBy<TPartition>(topology, partitionId): readonly TPartition[];

Defined in: topology/topology-queries.ts:43

Returns [partitionId, ...dependentsOf(topology, partitionId)], representing all partitions impacted by a change in partitionId.

Given db <- api <- web, affectedBy(topology, 'db') returns ['db', 'api', 'web'].

Type Parameters ​

Type ParameterDefault typeDescription
TPartition extends stringstringLiteral string union of partition identifiers in topology.

Parameters ​

ParameterTypeDescription
topologyMaybeBuilder<TopologyNode<TPartition>>Compiled TopologyNode or P.topology(...) builder.
partitionIdTPartitionSource partition identifier to query.

Returns ​

readonly TPartition[]

Frozen array starting with partitionId followed by its strict transitive dependents.

Throws ​

If partitionId is not a declared partition in topology.

Released under the MIT License.