title: How to fire just one result from a couple of emits in Kotlin coroutine flow?
body: <p>I have a flow like this:</p>
  <pre><code>fun createRawDataFlow() = callbackFlow&lt;String&gt; {
      SensorProProvider.getInstance(this@MainActivity).registerDataCallback { sensorProDeviceInfo, bytes -&gt;
          val dataString = bytes.map { it.toString() }.reduce { acc, s -&gt; &quot;$acc, $s&quot; }
          val hexString = HEXUtils.byteToHex(bytes)
          Log.e(&quot;onDataReceived&quot;, &quot;deviceInfo: ${sensorProDeviceInfo.deviceIdentify}, dataSize:${bytes.size}, data:$dataString&quot;)
          offer(hexString)
      }
      awaitClose {  }
  }
  
  
  GlobalScope.launch(Dispatchers.IO) {
      createRawDataFlow()
          .map {
              Log.e(&quot;onDataReceived&quot;, &quot;map2: ${Thread.currentThread().name}&quot;)
              // what I want is collecting 10 emits of sensor's data, and return a list of them
              // arraylistOf&lt;String&gt;(/* 10 hexStrings here*/)
          }
          .flowOn(Dispatchers.IO)
          .collect {
              Log.e(&quot;onDataReceived&quot;, &quot;thread: ${Thread.currentThread().name}, hexData:$it&quot;)
          }
  }
  </code></pre>
  <p>Just like the comment in the code. I wanna collect 10 hex strings from the flow because of these strings come from the same period of time, and then pack them in an array list for return. How can I achieve this? Is there any operator similar to map to do this? Btw, forgive my poor English.</p>