@@ -6,11 +6,6 @@ import com.adamratzman.spotify.utils.TimeUnit
6
6
import com.adamratzman.spotify.utils.getCurrentTimeMs
7
7
import com.adamratzman.spotify.utils.runBlocking
8
8
import com.adamratzman.spotify.utils.schedule
9
- import kotlin.coroutines.CoroutineContext
10
- import kotlin.coroutines.resume
11
- import kotlin.coroutines.resumeWithException
12
- import kotlin.coroutines.suspendCoroutine
13
- import kotlin.jvm.JvmOverloads
14
9
import kotlinx.coroutines.CancellationException
15
10
import kotlinx.coroutines.CoroutineScope
16
11
import kotlinx.coroutines.Dispatchers
@@ -25,6 +20,11 @@ import kotlinx.coroutines.flow.flow
25
20
import kotlinx.coroutines.flow.flowOn
26
21
import kotlinx.coroutines.launch
27
22
import kotlinx.coroutines.withContext
23
+ import kotlin.coroutines.CoroutineContext
24
+ import kotlin.coroutines.resume
25
+ import kotlin.coroutines.resumeWithException
26
+ import kotlin.coroutines.suspendCoroutine
27
+ import kotlin.jvm.JvmOverloads
28
28
29
29
/* *
30
30
* Provides a uniform interface to retrieve, whether synchronously or asynchronously, [T] from Spotify
@@ -159,7 +159,7 @@ class SpotifyRestActionPaging<Z : Any, T : AbstractPagingObject<Z>>(api: Spotify
159
159
@FlowPreview
160
160
@JvmOverloads
161
161
@ExperimentalCoroutinesApi
162
- fun flowOrdered (context : CoroutineContext = Dispatchers .Default ): Flow <Z > = flow< Z > {
162
+ fun flowOrdered (context : CoroutineContext = Dispatchers .Default ): Flow <Z > = flow {
163
163
emitAll(flowPagingObjectsOrdered().flatMapConcat { it.asFlow() })
164
164
}.flowOn(context)
165
165
@@ -169,7 +169,7 @@ class SpotifyRestActionPaging<Z : Any, T : AbstractPagingObject<Z>>(api: Spotify
169
169
@JvmOverloads
170
170
@ExperimentalCoroutinesApi
171
171
fun flowPagingObjectsOrdered (context : CoroutineContext = Dispatchers .Default ): Flow <AbstractPagingObject <Z >> =
172
- flow< AbstractPagingObject < Z >> {
172
+ flow {
173
173
complete().also { master ->
174
174
emitAll(master.flowStartOrdered())
175
175
emit(master)
@@ -183,7 +183,7 @@ class SpotifyRestActionPaging<Z : Any, T : AbstractPagingObject<Z>>(api: Spotify
183
183
@FlowPreview
184
184
@JvmOverloads
185
185
@ExperimentalCoroutinesApi
186
- fun flow (context : CoroutineContext = Dispatchers .Default ): Flow <Z > = flow< Z > {
186
+ fun flow (context : CoroutineContext = Dispatchers .Default ): Flow <Z > = flow {
187
187
emitAll(flowPagingObjects().flatMapConcat { it.asFlow() })
188
188
}.flowOn(context)
189
189
@@ -193,7 +193,7 @@ class SpotifyRestActionPaging<Z : Any, T : AbstractPagingObject<Z>>(api: Spotify
193
193
@JvmOverloads
194
194
@ExperimentalCoroutinesApi
195
195
fun flowPagingObjects (context : CoroutineContext = Dispatchers .Default ): Flow <AbstractPagingObject <Z >> =
196
- flow< AbstractPagingObject < Z >> {
196
+ flow {
197
197
complete().also { master ->
198
198
emitAll(master.flowBackward())
199
199
emit(master)
0 commit comments