Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Alexandre Balon-Perin
    @abalonperin

    Hi,

    I am trying to listen to a custom event with multiple parameters using scala-js-dom.

    Something like the following:

    $(document).on('my-custom-event', function(event, value) {
            //do something with value
    });

    My first attempt was to try using addEventListener (inherited from EventTarget) on a Node object.
    Unfortunately, the function only accept js.Function1[T, _] as a callback (see https://github.com/scala-js/scala-js-dom/blob/master/src/main/scala/org/scalajs/dom/raw/lib.scala#L2396).
    In the example above, I need a js.Function2[A, B, _]. Is there any way to go around this limitation?
    Thank you in advance for your help.