All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kreuzberg.SimpleComponentBase.scala Maven / Gradle / Ivy

There is a newer version: 0.10.3
Show newest version
package kreuzberg

import kreuzberg.*
import kreuzberg.dom.{ScalaJsElement, ScalaJsEvent}

/**
 * A Component base which uses a more imperative [[AssemblerContext]] for collecting event handlers and model
 * subscriptions.
 */
abstract class SimpleComponentBase extends SimpleContextDsl with Component {
  def assemble(using c: SimpleContext): Html

  override final def assemble(using context: AssemblerContext): Assembly = {
    val sc   = new SimpleContext(context)
    val html = assemble(using sc)
    Assembly(
      html = html,
      handlers = sc.eventBindings(),
      subscriptions = sc.subscriptions(),
      headless = sc.services()
    )
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy