all: add collection utils
Add new shortcut utilities for collecting StateFlows in a safe manner. The priamry addition here is collectImmediately. collectImmediately just calls block with the existing value initially, which helps remove a good amount of bugs regarding state initialization. Sure, it is a bit inefficient given that it will also initialize on startup, but this is okay. The other utilities are the same, but simply remove the launch boilerplate.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ui_scroll_thumb" />
|
||||
</selector>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
</selector>
|
||||
Reference in New Issue
Block a user