K Merle
09/10/2021, 7:48 AM@Composable
fun <T : FilterModel> FilterScreen(
listResult: Result<List<T>>,
filteredList: (list: List<T>) -> List<T>,
onItemSelect: (T) -> Unit,
navigate: () -> Unit
)
Adam Powell
09/10/2021, 1:40 PMK Merle
09/11/2021, 7:42 AMAdam Powell
09/11/2021, 1:49 PM@Composable
functions. Composable functions already cache lambdas you create within them so that cost is paid far less often, and inline composables omit the restart mechanism. That means that anything in an inline composable changing will cause the caller of the inline composable to recompose too, which can often result in compose doing more work when things change rather than less.Adam Powell
09/11/2021, 1:52 PMRow
and Column
are declared inline because they're often numerous and very deeply nested, and idiomatic compose code will already mean apps are declaring their own non-inline composables around the access of particular snapshot state to form appropriately granular recompose scopesAdam Powell
09/11/2021, 1:54 PMK Merle
09/12/2021, 9:35 AM