collectAsStateWithLifecycle() collects SharedFlow only after clicking a button
I found that SharedFlow is collected correctly by collectAsStateWithLifecycle() only when I click a button instead of waiting to timeout or when I change replay to 1. In other cases it is collected only once. StateFlow works correctly. Do you know any explanation of this behavior?
In compose collectAsStateWithLifecycle is not working
Problem: