wrap with trycatch StateFlowBasedRecyclerViewAdapter listener
This commit is contained in:
parent
6d999be590
commit
1c86f3f4bf
|
@ -15,6 +15,7 @@ abstract class StateFlowBasedRecyclerViewAdapter<T>(
|
|||
|
||||
init {
|
||||
dataState.onEach {
|
||||
try {
|
||||
val diffForRemoves = Diff(data, it)
|
||||
val removedIndexes = diffForRemoves.removed.map { it.index }
|
||||
val leftRemove = removedIndexes.toMutableList()
|
||||
|
@ -41,6 +42,9 @@ abstract class StateFlowBasedRecyclerViewAdapter<T>(
|
|||
notifyItemInserted(it.index)
|
||||
}
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
// currently do nothing
|
||||
}
|
||||
}.launchIn(listeningScope)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue