Re: [FlexJS]Promises

2016-11-17 Thread Alex Harui
On 11/17/16, 2:42 PM, "Harbs" wrote: > >On Nov 17, 2016, at 11:46 PM, Alex Harui wrote: > >> >> >> On 11/17/16, 11:21 AM, "Harbs" wrote: >> It looks like Promise does implement Ithenable. >>> Yes. I know. >>> >>> I did not word that very well. I’m not sure what I meant. I was >>>prob

Re: [FlexJS]Promises

2016-11-17 Thread Harbs
On Nov 17, 2016, at 11:46 PM, Alex Harui wrote: > > > On 11/17/16, 11:21 AM, "Harbs" wrote: > >>> It looks like Promise does implement Ithenable. >> Yes. I know. >> >> I did not word that very well. I’m not sure what I meant. I was probably >> talking about the AS3 implementation. I’m curre

Re: [FlexJS]Promises

2016-11-17 Thread Josh Tynjala
The compiler outputs ES5 syntax. You don't need to use ES6 syntax to use ES6 APIs, though. - Josh On Thu, Nov 17, 2016 at 1:46 PM, Alex Harui wrote: > > > On 11/17/16, 11:21 AM, "Harbs" wrote: > > >> It looks like Promise does implement Ithenable. > >Yes. I know. > > > >I did not word that ver

Re: [FlexJS]Promises

2016-11-17 Thread Alex Harui
On 11/17/16, 11:21 AM, "Harbs" wrote: >> It looks like Promise does implement Ithenable. >Yes. I know. > >I did not word that very well. I’m not sure what I meant. I was probably >talking about the AS3 implementation. I’m currently thinking that Promise >should implement IPromise which inherits

Re: [FlexJS]Promises

2016-11-17 Thread Harbs
> It looks like Promise does implement Ithenable. Yes. I know. I did not word that very well. I’m not sure what I meant. I was probably talking about the AS3 implementation. I’m currently thinking that Promise should implement IPromise which inherits from IThenable and ICatchable. Is there a wa

Re: [FlexJS]Promises

2016-11-17 Thread Alex Harui
I just looked at: flex-typedefs/target/generated-sources/externc/classes/Promise.as flex-typedefs/target/generated-sources/externc/interfaces/IThenable.as It looks like Promise does implement Ithenable. I don't think we are currently using es6. -Alex On 11/16/16, 3:04 PM, "Harbs" wrote: >I

Re: [FlexJS]Promises

2016-11-16 Thread Harbs
It seems to me that the extern is wrong. According to MDC, the return type for all Promise methods should be of type Promise.[1] Maybe Promise should implement IThenable (and possibly ICatchable), but I think Promise should return Promise. How do we patch the js files? I could also try to make

Re: [FlexJS]Promises

2016-11-16 Thread Josh Tynjala
Based on that really strange @template tag, Object is definitely the correct response from externc. Google seems to be doing something advanced there that I'm not even sure is documented. I also don't think we want to try to parse that mess. If we want it to return IThenable or something, then we

Re: [FlexJS]Promises

2016-11-16 Thread Harbs
On Nov 16, 2016, at 11:20 PM, Alex Harui wrote: > > > On 11/16/16, 11:07 AM, "Harbs" wrote: > >> >> So you are suggesting to make it a top-level class. Right? Otherwise >> we’re not good to go. >> >> Another problem with the definition in js.swc is that then() returns an >> Object, while i

Re: [FlexJS]Promises

2016-11-16 Thread Alex Harui
On 11/16/16, 11:07 AM, "Harbs" wrote: > >So you are suggesting to make it a top-level class. Right? Otherwise >we’re not good to go. > >Another problem with the definition in js.swc is that then() returns an >Object, while it should really return a Thenable. I don’t think Thenable >is defined a

Re: [FlexJS]Promises

2016-11-16 Thread Harbs
I did not realize there was already a Promise implementation. Cool! It does need catch(), but otherwise it seems pretty complete. > Please create an HTTPServiceWithPromises instead. Fine. > There is a Promise class in js.swc in the global package. If you > implement a SWF side for it you shou

Re: [FlexJS]Promises

2016-11-16 Thread Alex Harui
On 11/16/16, 1:52 AM, "Harbs" wrote: >In my attempt to port my Adobe InDesign flash panels to FlexJS, it became >clear to me very quickly that Promises is critical for a normal flow of >code. > >I needed to convert a synchronous flow of code to an asynchronous one and >Promises is a very import

Re: [FlexJS]Promises

2016-11-16 Thread Josh Tynjala
> -- > View this message in context: http://apache-flex- > development.247.n4.nabble.com/FlexJS-Promises-tp56515p56516.html > Sent from the Apache Flex Development mailing list archive at Nabble.com. >

Re: [FlexJS]Promises

2016-11-16 Thread OK
If you overlook this maybe this is helpful [1] Olaf [1] https://cwiki.apache.org/confluence/display/FLEX/AS3+Promises+-+a+guide+and+example -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Promises-tp56515p56516.html Sent from the Apache Flex

[FlexJS]Promises

2016-11-16 Thread Harbs
In my attempt to port my Adobe InDesign flash panels to FlexJS, it became clear to me very quickly that Promises is critical for a normal flow of code. I needed to convert a synchronous flow of code to an asynchronous one and Promises is a very important piece of that. For things like network, a