You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 31, 2018. It is now read-only.
util.toCallback(asyncFn) - interop of async functions with callbacks. #6
Similar to #5 I'm looking at ways to make the lives of callback users easier with async/await landing. I'm wondering if core should provide a method called toCallback that takes an async function and converts it to a callback returning function. This is similar to asCallback except taking a function:
asyncfunctionfooP(){// some async/await stuff// ...return"Hello";}constfoo=util.toCallback(fooP);foo((err,data)=>console.log(data));// hello
This issue is orthogonal (and certainly non-blocking) for the promises-in-core PR. It is only about async functions being more ergonomic to callback users.
Well, there are different stakeholders so I'd rather keep them separate. It seems like a generally good idea to keep discussions small to include participation. I don't feel very strongly about it though.
Activity
chrisdickinson commentedon Feb 15, 2016
Does anyone object to making this issue non-blocking for the Promises PR?
benjamingr commentedon Feb 15, 2016
This issue is orthogonal (and certainly non-blocking) for the promises-in-core PR. It is only about async functions being more ergonomic to callback users.
chrisdickinson commentedon Feb 15, 2016
Excellent! Did you see callbackify in the existing PR?
chrisdickinson commentedon Feb 15, 2016
Would you object to discussing a public
util.promisifyin this issue, or would you prefer to keep that separate?benjamingr commentedon Feb 17, 2016
Well, there are different stakeholders so I'd rather keep them separate. It seems like a generally good idea to keep discussions small to include participation. I don't feel very strongly about it though.
benjamingr commentedon Jul 4, 2017
This landed