@@ -18,6 +18,7 @@ import kotlinx.coroutines.channels.awaitClose
1818import kotlinx.coroutines.channels.trySendBlocking
1919import kotlinx.coroutines.flow.Flow
2020import kotlinx.coroutines.flow.callbackFlow
21+ import kotlinx.coroutines.flow.conflate
2122import kotlinx.coroutines.flow.flowOn
2223import kotlin.coroutines.resume
2324import kotlin.coroutines.suspendCoroutine
@@ -258,151 +259,151 @@ suspend fun MapboxMap.setFeatureState(
258259}
259260
260261/* *
261- * [Flow] of [MapLoaded] updates from [MapboxMap.subscribeMapLoaded].
262+ * Conflated [Flow] of [MapLoaded] updates from [MapboxMap.subscribeMapLoaded].
262263 */
263264val MapboxMap .mapLoadedEvents: Flow <MapLoaded >
264265 @JvmSynthetic
265266 get() = callbackFlow<MapLoaded > {
266267 val cancelable = nativeObserver.subscribeMapLoaded(::trySendBlocking, onCancel = channel::close)
267268 awaitClose(cancelable::cancel)
268- }.flowOn(Dispatchers .Main .immediate)
269+ }.flowOn(Dispatchers .Main .immediate).conflate()
269270
270271/* *
271- * [Flow] of [MapLoadingError] updates from [MapboxMap.subscribeMapLoadingError].
272+ * Conflated [Flow] of [MapLoadingError] updates from [MapboxMap.subscribeMapLoadingError].
272273 */
273274val MapboxMap .mapLoadingErrorEvents: Flow <MapLoadingError >
274275 @JvmSynthetic
275276 get() = callbackFlow<MapLoadingError > {
276277 val cancelable = nativeObserver.subscribeMapLoadingError(::trySendBlocking, onCancel = channel::close)
277278 awaitClose(cancelable::cancel)
278- }.flowOn(Dispatchers .Main .immediate)
279+ }.flowOn(Dispatchers .Main .immediate).conflate()
279280
280281/* *
281- * [Flow] of [StyleLoaded] updates from [MapboxMap.subscribeStyleLoaded].
282+ * Conflated [Flow] of [StyleLoaded] updates from [MapboxMap.subscribeStyleLoaded].
282283 */
283284val MapboxMap .styleLoadedEvents: Flow <StyleLoaded >
284285 @JvmSynthetic
285286 get() = callbackFlow<StyleLoaded > {
286287 val cancelable = nativeObserver.subscribeStyleLoaded(::trySendBlocking, onCancel = channel::close)
287288 awaitClose(cancelable::cancel)
288- }.flowOn(Dispatchers .Main .immediate)
289+ }.flowOn(Dispatchers .Main .immediate).conflate()
289290
290291/* *
291- * [Flow] of [StyleDataLoaded] updates from [MapboxMap.subscribeStyleDataLoaded].
292+ * Conflated [Flow] of [StyleDataLoaded] updates from [MapboxMap.subscribeStyleDataLoaded].
292293 */
293294val MapboxMap .styleDataLoadedEvents: Flow <StyleDataLoaded >
294295 @JvmSynthetic
295296 get() = callbackFlow<StyleDataLoaded > {
296297 val cancelable = nativeObserver.subscribeStyleDataLoaded(::trySendBlocking, onCancel = channel::close)
297298 awaitClose(cancelable::cancel)
298- }.flowOn(Dispatchers .Main .immediate)
299+ }.flowOn(Dispatchers .Main .immediate).conflate()
299300
300301/* *
301- * [Flow] of [CameraChanged] updates from [MapboxMap.subscribeCameraChanged].
302+ * Conflated [Flow] of [CameraChanged] updates from [MapboxMap.subscribeCameraChanged].
302303 */
303304val MapboxMap .cameraChangedEvents: Flow <CameraChanged >
304305 @JvmSynthetic
305306 get() = callbackFlow<CameraChanged > {
306307 val cancelable = nativeObserver.subscribeCameraChanged(::trySendBlocking, onCancel = channel::close)
307308 awaitClose(cancelable::cancel)
308- }.flowOn(Dispatchers .Main .immediate)
309+ }.flowOn(Dispatchers .Main .immediate).conflate()
309310
310311/* *
311- * [Flow] of [MapIdle] updates from [MapboxMap.subscribeMapIdle].
312+ * Conflated [Flow] of [MapIdle] updates from [MapboxMap.subscribeMapIdle].
312313 */
313314val MapboxMap .mapIdleEvents: Flow <MapIdle >
314315 @JvmSynthetic
315316 get() = callbackFlow<MapIdle > {
316317 val cancelable = nativeObserver.subscribeMapIdle(::trySendBlocking, onCancel = channel::close)
317318 awaitClose(cancelable::cancel)
318- }.flowOn(Dispatchers .Main .immediate)
319+ }.flowOn(Dispatchers .Main .immediate).conflate()
319320
320321/* *
321- * [Flow] of [SourceAdded] updates from [MapboxMap.subscribeSourceAdded].
322+ * Conflated [Flow] of [SourceAdded] updates from [MapboxMap.subscribeSourceAdded].
322323 */
323324val MapboxMap .sourceAddedEvents: Flow <SourceAdded >
324325 @JvmSynthetic
325326 get() = callbackFlow<SourceAdded > {
326327 val cancelable = nativeObserver.subscribeSourceAdded(::trySendBlocking, onCancel = channel::close)
327328 awaitClose(cancelable::cancel)
328- }.flowOn(Dispatchers .Main .immediate)
329+ }.flowOn(Dispatchers .Main .immediate).conflate()
329330
330331/* *
331- * [Flow] of [SourceRemoved] updates from [MapboxMap.subscribeSourceRemoved].
332+ * Conflated [Flow] of [SourceRemoved] updates from [MapboxMap.subscribeSourceRemoved].
332333 */
333334val MapboxMap .sourceRemovedEvents: Flow <SourceRemoved >
334335 @JvmSynthetic
335336 get() = callbackFlow<SourceRemoved > {
336337 val cancelable = nativeObserver.subscribeSourceRemoved(::trySendBlocking, onCancel = channel::close)
337338 awaitClose(cancelable::cancel)
338- }.flowOn(Dispatchers .Main .immediate)
339+ }.flowOn(Dispatchers .Main .immediate).conflate()
339340
340341/* *
341- * [Flow] of [SourceDataLoaded] updates from [MapboxMap.subscribeSourceDataLoaded].
342+ * Conflated [Flow] of [SourceDataLoaded] updates from [MapboxMap.subscribeSourceDataLoaded].
342343 */
343344val MapboxMap .sourceDataLoadedEvents: Flow <SourceDataLoaded >
344345 @JvmSynthetic
345346 get() = callbackFlow<SourceDataLoaded > {
346347 val cancelable = nativeObserver.subscribeSourceDataLoaded(::trySendBlocking, onCancel = channel::close)
347348 awaitClose(cancelable::cancel)
348- }.flowOn(Dispatchers .Main .immediate)
349+ }.flowOn(Dispatchers .Main .immediate).conflate()
349350
350351/* *
351- * [Flow] of [StyleImageMissing] updates from [MapboxMap.subscribeStyleImageMissing].
352+ * Conflated [Flow] of [StyleImageMissing] updates from [MapboxMap.subscribeStyleImageMissing].
352353 */
353354val MapboxMap .styleImageMissingEvents: Flow <StyleImageMissing >
354355 @JvmSynthetic
355356 get() = callbackFlow<StyleImageMissing > {
356357 val cancelable =
357358 nativeObserver.subscribeStyleImageMissing(::trySendBlocking, onCancel = channel::close)
358359 awaitClose(cancelable::cancel)
359- }.flowOn(Dispatchers .Main .immediate)
360+ }.flowOn(Dispatchers .Main .immediate).conflate()
360361
361362/* *
362- * [Flow] of [StyleImageRemoveUnused] updates from [MapboxMap.subscribeStyleImageRemoveUnused].
363+ * Conflated [Flow] of [StyleImageRemoveUnused] updates from [MapboxMap.subscribeStyleImageRemoveUnused].
363364 */
364365val MapboxMap .styleImageRemoveUnusedEvents: Flow <StyleImageRemoveUnused >
365366 @JvmSynthetic
366367 get() = callbackFlow<StyleImageRemoveUnused > {
367368 val cancelable =
368369 nativeObserver.subscribeStyleImageRemoveUnused(::trySendBlocking, onCancel = channel::close)
369370 awaitClose(cancelable::cancel)
370- }.flowOn(Dispatchers .Main .immediate)
371+ }.flowOn(Dispatchers .Main .immediate).conflate()
371372
372373/* *
373- * [Flow] of [RenderFrameStarted] updates from [MapboxMap.subscribeRenderFrameStarted].
374+ * Conflated [Flow] of [RenderFrameStarted] updates from [MapboxMap.subscribeRenderFrameStarted].
374375 */
375376val MapboxMap .renderFrameStartedEvents: Flow <RenderFrameStarted >
376377 @JvmSynthetic
377378 get() = callbackFlow<RenderFrameStarted > {
378379 val cancelable =
379380 nativeObserver.subscribeRenderFrameStarted(::trySendBlocking, onCancel = channel::close)
380381 awaitClose(cancelable::cancel)
381- }.flowOn(Dispatchers .Main .immediate)
382+ }.flowOn(Dispatchers .Main .immediate).conflate()
382383
383384/* *
384- * [Flow] of [RenderFrameFinished] updates from [MapboxMap.subscribeRenderFrameFinished].
385+ * Conflated [Flow] of [RenderFrameFinished] updates from [MapboxMap.subscribeRenderFrameFinished].
385386 */
386387val MapboxMap .renderFrameFinishedEvents: Flow <RenderFrameFinished >
387388 @JvmSynthetic
388389 get() = callbackFlow<RenderFrameFinished > {
389390 val cancelable =
390391 nativeObserver.subscribeRenderFrameFinished(::trySendBlocking, onCancel = channel::close)
391392 awaitClose(cancelable::cancel)
392- }.flowOn(Dispatchers .Main .immediate)
393+ }.flowOn(Dispatchers .Main .immediate).conflate()
393394
394395/* *
395- * [Flow] of [ResourceRequest] updates from [MapboxMap.subscribeResourceRequest].
396+ * Conflated [Flow] of [ResourceRequest] updates from [MapboxMap.subscribeResourceRequest].
396397 */
397398val MapboxMap .resourceRequestEvents: Flow <ResourceRequest >
398399 @JvmSynthetic
399400 get() = callbackFlow<ResourceRequest > {
400401 val cancelable = nativeObserver.subscribeResourceRequest(::trySendBlocking, onCancel = channel::close)
401402 awaitClose(cancelable::cancel)
402- }.flowOn(Dispatchers .Main .immediate)
403+ }.flowOn(Dispatchers .Main .immediate).conflate()
403404
404405/* *
405- * [Flow] of [GenericEvent] updates from [MapboxMap.subscribeGenericEvent].
406+ * Conflated [Flow] of [GenericEvent] updates from [MapboxMap.subscribeGenericEvent].
406407 */
407408@JvmSynthetic
408409@MapboxExperimental
@@ -411,7 +412,7 @@ fun MapboxMap.genericEvents(eventName: String): Flow<GenericEvent> {
411412 val cancelable =
412413 nativeObserver.subscribeGenericEvent(eventName, ::trySendBlocking, onCancel = channel::close)
413414 awaitClose(cancelable::cancel)
414- }.flowOn(Dispatchers .Main .immediate)
415+ }.flowOn(Dispatchers .Main .immediate).conflate()
415416}
416417
417418/* *
0 commit comments