Skip to content

Commit

Permalink
Add LazyListScope#itemsIndexed
Browse files Browse the repository at this point in the history
  • Loading branch information
veyndan committed Apr 18, 2023
1 parent 325129f commit b4de466
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ public inline fun <T> LazyListScope.items(
itemContent(items[it])
}

public inline fun <T> LazyListScope.itemsIndexed(
items: List<T>,
crossinline itemContent: @Composable (index: Int, item: T) -> Unit,
): Unit = items(
count = items.size,
) {
itemContent(it, items[it])
}

public inline fun <T> LazyListScope.items(
items: Array<T>,
crossinline itemContent: @Composable (item: T) -> Unit,
Expand Down

0 comments on commit b4de466

Please sign in to comment.