EventListener

com.raquo.laminar.modifiers.EventListener
See theEventListener companion object
class EventListener[Ev <: Event, Out](val eventProcessor: EventProcessor[Ev, Out], val callback: Out => Unit) extends Binder[Base]

Attributes

Companion
object
Graph
Supertypes
trait Binder[Base]
trait Modifier[Base]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def bind(element: Base): DynamicSubscription

This method is used by onMountBind to cancel this subscription on unmount

This method is used by onMountBind to cancel this subscription on unmount

Attributes

Definition Classes
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

final override def apply(element: Base): Unit

You can count on this method being a no-op in your libraries and end user code.

You can count on this method being a no-op in your libraries and end user code.

The reason this method is not abstract is to avoid broken SAM sugar in case of meta modifiers. See https://github.com/raquo/scala-dom-types/issues/27

Attributes

Definition Classes
Inherited from:
Binder

Concrete fields

val callback: Out => Unit
val domCallback: Function1[Ev, Unit]

To make sure that you remove the event listener successfully in JS DOM, you need to provide the same Javascript callback function that was originally added as a listener. However, the implicit conversion from a Scala function to a JS function creates a new JS function every time, so we would never get referentially equal JS functions if we used the Scala-to-JS conversion more than once. Therefore, we need to perform that conversion only once and save the result. This method encapsulates such conversion.

To make sure that you remove the event listener successfully in JS DOM, you need to provide the same Javascript callback function that was originally added as a listener. However, the implicit conversion from a Scala function to a JS function creates a new JS function every time, so we would never get referentially equal JS functions if we used the Scala-to-JS conversion more than once. Therefore, we need to perform that conversion only once and save the result. This method encapsulates such conversion.

Attributes

val options: EventListenerOptions

Deprecated fields

val domValue: Function1[Ev, Unit]

Attributes

Deprecated
true