Equality-based conflation suppresses a new state-flow emission when the assigned value equals the value already represented. It keeps state updates focused on actual changes rather than repeated assignments. section 16.3.2 section 16.4
Repeated direction assignments
A DirectionSelector starts at LEFT and updates its state with _direction.update { d }. A collector logs LEFT, RIGHT, and LEFT when those values change; a later turn(Direction.LEFT) produces no additional log because LEFT is already represented. section 16.3.2
Figure 16.6 State flows perform equality-based conflation. When the value is assigned the same value as is already set, no new elements are emitted.
Use the figure to see the rule directly: assigning the current value again emits no new element. section 16.3.2
The technique belongs to StateFlow, which represents one current value. SharedFlow instead broadcasts emissions to subscribers, so reframing a message stream as state—such as a growing message-history list—can let later collectors observe prior updates. section 16.3.3
