On Sun, Dec 6, 2015 at 10:48 PM, Andrea Giammarchi <andrea.giammar...@gmail.com> wrote: > 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.
This pattern is fine; different overloads of a function are basically different functions, and we're using this pattern in the web platform in a few places to "update" some CB-using APIs to Promises. As long as the function previously returned void and took the CB last, we can do it. ~TJ _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss