Closed bbarker closed 2 years ago
So, you want to use MouseEvent => Rx[Unit]
an a xml attribute... Could you used Rx[MouseEvent => Unit]
instead?
Good point, this seems to work:
val actionHandler = action.command().map{ actResMaybe =>
(_: MouseEvent) => actResMaybe match {
case Some(actRes) => actionResult := actRes
case None => println("no RunResult")
}
}
Thought it feels slightly unnatural to have to do so - I'll adjust the PR later today to address your comment, thanks!
If Rx[MouseEvent => Unit]
works for you then I think we don't need to change anything as you can get an instance for that type with rxAttributeEmbeddable(function1AttributeEmbeddable[MouseEvent])
Oh, yes, it works, and I'm happy enough with it for now. But this PR would allow more expressions (and shorter expressions) to work that are equivalent, which seems to be a desirable goal.
@bbarker I'm closing your long-standing PR as part of my repo clean-up, I hope you don't mind. Feel free to reopen/ping me if you want to bring anything back to life!
Use case:
If this makes sense, would it be OK to publish an RC2 - I have some production code that may depend on this working, though I guess i could get around it by manually working with
Cancelable
s