Monday, January 15, 2018

@FunctionalInterface VS @JsFunction


Would it be possible for GWTc to handle java.lang.FunctionalInterface as if it was jsinterop.annotations.JsFunction ?
The reason for asking is, I have this java code:

    public void transaction(Runnable runnable) {
        try {
        finally {

when I expose this method via jsinterop I get a warning "not usable from javascript"

I intent to use it from JS/TS as: myJavaLib.transaction(() => doSomethingInTransaction(...));

but this is not possible unless I supersource java.lang.Runnable and add @JsFunction 

It seems to me that @FunctionalInterface and @JsFunction are very similar already...

Regards Jan 

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment