I'm working on a Chrome extension. I'm a little confused on the callbacks. I have some situations where I would need to have multiple async calls. For example, I have
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
}
Inside of this I need to make a call to chrome.storage.local.remove and chrome.storage.local.set. The response to the message would be based on the results of the remote and set. If they fail of course a different response would be sent.
How should this be handled?