Reflection to know if executed within a generator/async ?
miguel de Sousa
miguel.tronix at gmail.com
Mon Dec 7 08:02:16 UTC 2015
I have an objection to that, async is just a special case of sync, like
square to rectangle. Why shouldn't the promise be inviolable?
On Mon, 7 Dec 2015 7:00 pm Claude Pache <claude.pache at gmail.com> wrote:
> Le 7 déc. 2015 à 07:48, Andrea Giammarchi <andrea.giammarchi at gmail.com> a
> écrit :
> I've asked for opinions and if in 2 days I haven't replied means I got it
> my idea is not welcome which is OK and fair enough.
> However, I'm curious to know about this "Functions that sometimes return
> promises and sometimes not are already known to be an antipattern"
> because I have a library that does that in somehow explicit way (if you
> pass a callback it doesn't return a promise, it invokes such callback once
> resolved) and it works without any real-world problem.
> Mind pointing me at the library that failed returning Promises arbitrarily?
> The blog post pointed by Ron earlier in this thread contains a discussion
> about how sync and async code differ, and thus why it is generally not a
> good idea to execute random code sometimes asynchronously and sometimes not
> (with a pointer to a concrete example). It is worth reading.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss