mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-27 04:28:46 +00:00
improve AttrsWithContentBuilder functions
This commit is contained in:
parent
67a6998f02
commit
53b020ab8d
@ -8,8 +8,12 @@ import org.w3c.dom.Element
|
||||
typealias AttrsWithContentBuilder<T> = Pair<Attrs<T>, ContentBuilder<T>>
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun <T : Element> AttrsWithContentBuilder(noinline builder: ContentBuilder<T>) = AttrsWithContentBuilder(
|
||||
Attrs.empty(),
|
||||
inline fun <T : Element> AttrsWithContentBuilder(
|
||||
vararg modifiers: UIKitModifier?,
|
||||
noinline attrs: AttrsScope<T>.() -> Unit = {},
|
||||
noinline builder: ContentBuilder<T>
|
||||
) = AttrsWithContentBuilder(
|
||||
Attrs(*modifiers, attrs = attrs),
|
||||
builder
|
||||
)
|
||||
|
||||
@ -18,15 +22,6 @@ inline fun <T : Element> AttrsWithContentBuilder(attrs: Attrs<T>) = AttrsWithCon
|
||||
attrs
|
||||
) {}
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun <T : Element> AttrsWithContentBuilder(
|
||||
modifier: UIKitModifier?,
|
||||
vararg modifiers: UIKitModifier?,
|
||||
noinline attrs: AttrsScope<T>.() -> Unit = {}
|
||||
) = AttrsWithContentBuilder(
|
||||
Attrs(modifier, *modifiers, attrs = attrs)
|
||||
)
|
||||
|
||||
inline val <T : Element> AttrsWithContentBuilder<T>.attrs
|
||||
get() = first
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user