Loading remote data, caching, and continuing in javascript
问题 Basic use case. I have a global variable where I store remotely pulled data. If there is no data then I want to load it initially, wait for it load, and then continue processing. I don't really want to use a synchronous process if I don't have to. Consider something like this where _companies is a global variable... if (_companies === undefined || _companies.length == 0) { loadExternalData(); } // do something with the data in _companies I feel like I'm missing something obvious. I understand