repeatOnSubscription
Starts and stops the provided block of code based on the number of subscribers to the Container.refCountStateFlow and Container.refCountSideEffectFlow.
If the number of subscribers reaches non-zero, the block is run. When the number of subscribers reaches zero, the block is cancelled after a short delay. The delay can be set when creating the Container using SettingsBuilder.repeatOnSubscribedStopTimeout.
This API is useful for collecting hot flows.
Parameters
block
the lambda to run when we have active subscribers.