nes.flow/Flow///PointingToDeclaration/">Flow</span> with the ability to stop its collection early based on a custom condition.</p><p class="paragraph">Example usage:</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">stoppableFlow&lt;Int&gt; {<br>    for (i in 1..10) {<br>        if (i == 5) halt("Stopping at 5")<br>        emit(i)<br>    }<br>} // 1, 2, 3, 4</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-le