You could simply make the XHR async, and let this.components get set when the XHR loads, as you're doing already. Is there any other reason why it needs to be synchronous? If there is a reason, can you just use a Promise that resolves/rejects on load/error?
Never use sync XHRs; they peg the browser.
You could simply make the XHR async, and let
this.components
get set when the XHR loads, as you're doing already. Is there any other reason why it needs to be synchronous? If there is a reason, can you just use aPromise
that resolves/rejects on load/error?