Skip to content

Instantly share code, notes, and snippets.

View electrolobzik's full-sized avatar

Roman Chernyak electrolobzik

  • Barcelona, Spain
  • 11:12 (UTC +02:00)
View GitHub Profile
/**
* Created by Roman Chernyak (aka @electrolobzik) on 2024-02-22
*/
class Paginator<Data : Any, Cursor : Any>(
coroutineContext: CoroutineContext
) : CoroutineScope by CoroutineScope(coroutineContext) {
private val _state = MutableStateFlow<State<Data, Cursor>>(State.NoData.Empty())
private val _sideEffects = MutableSharedFlow<SideEffect<Cursor>>()
private val inputActions = MutableSharedFlow<Action<Data, Cursor>>()
class ReceivedMediaRepository(
private val receivedMediaApiHelper: ReceivedMediaApiHelper,
private val receivedMediaDbHelper: ReceivedMediaDbHelper,
coroutineContext: CoroutineContext,
) : CoroutineScope by CoroutineScope(coroutineContext) {
private val coroutineScope = CoroutineScope(coroutineContext)
private val factory = ReceivedMediaStoreFactory(api = receivedMediaApiHelper, db = receivedMediaDbHelper)
private val mutableStore = factory.create()