I have found user-management module in npm and it seemed like a very useful and simple module to manage users with mongodb, but as I started using it in my express app I noticed all of its functions are async, meaning that if I try to use a user property for example after loading the user, I cannot since it happens non sync to my main code. To be more clear, my code will use unassigned variables since the user functions work asyncly outside of my function thread. Is there an elegant(or non elegant for that matter) way to work around async functions? I have tried to use async.until and async.whilst but doesn't seem to work. Since I am on phone and work on a closed network I can't publish my code but I hope I was clear enough with my problem and the solution I am looking for.
Thanks in advance to anyone who could help with my struggle!
via Alex Kipper
No comments:
Post a Comment