Wednesday, August 20, 2014

JsInterop advance?

Community: 
     I'm playing with JsInterop , and I have two questions: 

     1) Are you planning to try the static methods of JS objects, such as Object, Promise, etc.? 
     2) How do when an instance is mapped to an existing Object, eg Promise, has a constructor with parameters? 
  
    Currently to resolve this 1) I created the following class Factory: JS

    But the interfaces define a contract at the level instance of a class or object, this way of doing things, I do not know if it is semantically correct. 

   To solve 2) there are not many options: 

     Create a Factory that returns an instance of the object, because it has no meaning, only to make the new, implement the interface, because the compiler already does. 
     There is some progress in this? 

     I saw in one of the post a proposal to do something like this: 
 
     Promise Promise.Prototype p = new (new Function ....., new Function ....);

    Where Promise, is the interface defined with prototype = "Promise". 

    @JsType(isNative = true, prototype = "Promise")
   
public interface Promise {
   
     
void then(Function f);
   
     
void cath(Function f);
 
}

    Here 'access to jsCore project: 
  

I hope the answers ... 

greetings

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment