I have a question regarding asynchronous callbacks. I think it’s easiest to start by showing an example of what I am trying to do.
var currentLog = logCollection.findById(currentId);
loadLog(currentLog, currentId);
My problem is that currentLog just isn’t defined by the time ‘loadLog()’ is being called. I know this can be solved using a callback function but all the examples in the documentation are synchronous and I’m just a little confused on how to format it. Do I need to define an Async() function? If you could just show me how it would work in this simple example I think I could put the rest together myself.
Thanks.