Clarification for derived promises

2015-07-14 Thread Nicholas C. Zakas
Hi all, I'm trying to wrap my head around derived promises and wanted to ask for a bit of clarification around how `Promise.resolve()` works from a derived class. Consider this: ``` class MyPromise extends Promise {} var p1 = new Promise(function(resolve, reject) { resolve(42); }); var

Re: Clarification for derived promises

2015-07-14 Thread Domenic Denicola
Yes. On Tue, Jul 14, 2015 at 10:10 AM -0700, Nicholas C. Zakas standa...@nczconsulting.commailto:standa...@nczconsulting.com wrote: Hi all, I'm trying to wrap my head around derived promises and wanted to ask for a bit of clarification around how `Promise.resolve()` works from a derived

Re: Clarification for derived promises

2015-07-14 Thread Nicholas C. Zakas
Awesome, thank you! -N On 7/14/2015 10:12 AM, Domenic Denicola wrote: Yes. On Tue, Jul 14, 2015 at 10:10 AM -0700, Nicholas C. Zakas standa...@nczconsulting.com mailto:standa...@nczconsulting.com wrote: Hi all, I'm trying to wrap my head around derived promises and wanted to ask for a

Re: Clarification for derived promises

2015-07-14 Thread C. Scott Ananian
And --- apologies for continuing to beat this drum --- you can look at the `prfun` package on npm for a practical example of this use of Promise subclasses and `resolve`. If other folks know of other libraries using these features, let me know so I can recommend other people's code as well as my