Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean multiple bindings #986

Merged
merged 1 commit into from May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -17,6 +17,10 @@ trait Binding extends Modifier[Element] {
nestedBindings.push(binding)
binding
}
override def multi(bindings: Binding*): bindings.type = {
nestedBindings.push(bindings: _*)
ddworak marked this conversation as resolved.
Show resolved Hide resolved
bindings
}
}

def addRegistration(registration: Registration): Unit = propertyListeners += registration
Expand All @@ -40,6 +44,10 @@ object Binding {
/** Every interceptor is expected to return the value received as argument. */
trait NestedInterceptor {
def apply(binding: Binding): binding.type
def multi(bindings: Binding*): bindings.type = {
bindings.foreach(apply(_))
bindings
}
}

object NestedInterceptor {
Expand Down
Expand Up @@ -1912,7 +1912,7 @@ class TagsBindingTest extends UdashFrontendTest with Bindings { bindings: Bindin

val el = div(
repeatWithIndex(p) { case (item, idx, nested) =>
span(nested(bind(idx)), nested(bind(item))).render
span(nested.multi(bind(idx), nested(bind(item)))).render
}
).render

Expand Down