Closed AddoSolutions closed 7 years ago
My understanding is the foundation for async/await is promises.
every async function you write will return a promise, and every single thing you await will ordinarily be a promise.
Via: https://medium.com/@bluepnume/learn-about-promises-before-you-start-using-async-await-eb148164a9c8
The idea of uses promises has been brought up before: #6 #20 and in both of those issue I've linked back to https://github.com/jedireza/hapi-mongo-models/issues/6
Like I said in that hapi-mongo-models
thread:
I almost never use promises. If it's as simple as mentioned above and doesn't disturb the existing API, a PR is welcomed.
:mega: Async/await support is on the menu now. Tracked via: https://github.com/jedireza/mongo-models/issues/24 and help is very much appreciated.
Hello,
I am not sure if there is an open issue on this or if I am doing something wrong, but I do not beleive this library properly complies with the NodeJS native async protocol:
Example:
I did some tweaking on my own fork, and found that I could get it working, but I do not know how this plays with compatibility with other versions:
Any thoughts on this, feel free to take a peek at my fork, but I am not sure how you would implement this with compatibility.
Nick