mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-30 05:58:45 +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>>
|
typealias AttrsWithContentBuilder<T> = Pair<Attrs<T>, ContentBuilder<T>>
|
||||||
|
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun <T : Element> AttrsWithContentBuilder(noinline builder: ContentBuilder<T>) = AttrsWithContentBuilder(
|
inline fun <T : Element> AttrsWithContentBuilder(
|
||||||
Attrs.empty(),
|
vararg modifiers: UIKitModifier?,
|
||||||
|
noinline attrs: AttrsScope<T>.() -> Unit = {},
|
||||||
|
noinline builder: ContentBuilder<T>
|
||||||
|
) = AttrsWithContentBuilder(
|
||||||
|
Attrs(*modifiers, attrs = attrs),
|
||||||
builder
|
builder
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -18,15 +22,6 @@ inline fun <T : Element> AttrsWithContentBuilder(attrs: Attrs<T>) = AttrsWithCon
|
|||||||
attrs
|
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
|
inline val <T : Element> AttrsWithContentBuilder<T>.attrs
|
||||||
get() = first
|
get() = first
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user