Monday, October 16, 2017

Re: Is there a good tutorial with examples for JSInterop available somewhere ?

The most in-depth documentation is already linked at the very bottom of the corresponding page:

In addition there is a document which talks about union types in elemental2 which can be helpful as well if you have to deal with union types:

In general if you want to consume existing JS API then just model that API using @JsType(isNative = true, ...) annotated classes and for callbacks use @JsFunction annotated interfaces. Your small example could be something like:

@JsType(isNative = true, ....) // TODO: namespace, name
class Items {
native void on(String event, ItemsEventCallback callback);

interface ItemsEventCallback {
void onEvent(Object event, Object properties); // TODO: parameter types should probably of a specific type but I don't know the JS library so have used Object here.

-- J.

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