How to wait for a bluebird promise to settle in multiple locations?
Clash Royale CLAN TAG #URR8PPP How to wait for a bluebird promise to settle in multiple locations? I have a situation where a bunch of functions are needing to wait for a promise to settle because it's the init function; self.init=new Promise(function(resolve){ //do stuff, take awhile resolve(); }); But, while it's init'ing, the async nature means other functions that depend on it being init are being called. I want those functions to wait for the init to finish, then continue. I tried doing this inside each function function doSomethingUseful(){ self.init.reflect().then(function () { //do functions purpose }); } function doSomethingUseless(){ self.init.reflect().then(function () { //do functions purpose }); } But it only works randomly, probably only works if init has settled, and if it hasn't, it just hangs here, weirdly hangs the whole app, despite it being async. I am trying to replace a former solution that involved intervals an...