Skip to content

Commit f8e8279

Browse files
committed
Add an attrs helper function
1 parent 96334bb commit f8e8279

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compose-web-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/AttrBuilderContext.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ operator fun <TElement : Element> AttrBuilderContext<TElement>.plus(other: AttrB
1111
other()
1212
}
1313
}
14+
15+
/** A helper function to create [AttrBuilderContext]s where type inference doesn't work */
16+
@Suppress("NOTHING_TO_INLINE")
17+
inline fun <TElement : Element> attrs(noinline attrs: AttrBuilderContext<TElement>) =
18+
attrs

0 commit comments

Comments
 (0)