I'm making an ajax call to the server which returns me some data that I'm storing in a localStorage item (No need to explain why, but needs to be like that).
Then I need to restore that localStorage item in a following ajax call, right after the first one.
MY PROBLEM: Being asyncronous, the second call starts before the variable is set, so Im getting null.
I tried "when.done", "when.then", calling the second on the first's success... and nothing seems to work.