Conflict Between Asynchronous HTTP Requests for Constructed Object Initialization And Use of Object's Methods

In developing a single page web application, I have a constructor whose initialization of some properties requires getting data asynchronously using HTTP requests. The methods of the constructed instances (objects) also implement asynchronous HTTP requests.

The requirement is that the newly constructed object initialization process should be completed before any of its methods execute or undefined behavior is certain, since the methods may depend on property values having been defined/assigned with initialization complete. My problem is that the threads of methods are executing before the thread of initialization is complete.

When initialization depends on asynchronous HTTP requests, that means finding the optimal means of coding. So the question is, what is the most optimal and/or elegant means of coding to ensure initialization is complete? I can do initialization with synchronous HTTP requests, but the browsers will complain about use of deprecated processes and could very well not allow them in the future.

Note: I have limitations on what scripting I can do/choose because the enterprise is still using Internet Explorer 11. Thus I can make use of promises using RSVP or of polyfills.

To illustrate in a practical way what I am asking, the model of code below (this code is very much abbreviated or stripped down) shows a main function (webAppProcess()). This would be invoked by a form control event handler, not with the loading of a web page; that distinction might be an important consideration in the question posed here. webAppProcess() instantiates an object which works with SharePoint lists, creating or retrieving item data. The object builds requests and obtains responses using SharePoint’s REST API asynchronously using promises compatible for the browser. Initialization of object during construction, wrapped in a method called during instantiation, sets the values of a few of its properties.

But when webAppProcess() is called, just after the constructor returns without the guarantee of complete initialization, a couple of its methods are immediately called. In the implementation, they execute without the properties upon which they depend having been defined, since initialization has not yet completed.

What can be done without:

  1. making use of synchronous HTTP requests in initialization?
  2. polluting the global namespace by constructing the object during page load and then using it for the event handler?
  3. adding code to every method that involves checking state and setting callbacks?
function webAppProcess() {
	var iRestRequests = new ISharePointListREST("Server Name");

// this next method call has errors because initialization 
//   execution thread did not finish
	iRestRequests.createListItem(
		args
	).then(function (response) {
		// process the wanted response
	}).catch(function (response) {
		// report the exception
	});
	
	iRestRequests.getListItem(
		args
	).then(function (response) {
		// process the wanted response
	}).catch(function (response) {
		// report the exception
	});
}

function ISharePointListREST (serverName) {
	var thisObjectInstance = this;
	this.serverName = serverName;
	this.initializedVariableFromServer1;
	this.initializedVariableFromServer2;
	this.initializedVariableFromServer3;
	
	this.initialize = function () {
		// sets several properties of the object but 
		//  only when the HTTP request is fulfilled
		httpRequest(parameters).then(function (response) {
			thisObjectInstance.initializedVariableFromServer1 = response[1];
			thisObjectInstance.initializedVariableFromServer2 = response[2];
			thisObjectInstance.initializedVariableFromServer3 = response[3];
		}).catch(function (response) {
			// code to handle exception
		});
	};
	
	this.getListItem = function (parameters) {
		// this.initializedVariableFromServer1 must be defined,
		//  which requires initialization to be complete
		params.arg1 = this.initializedVariableFromServer1;
		return httpRequest(params);
	};
	this.createListItem = function (parameters) {
		// this.initializedVariableFromServer2 and
		// this.initializedVariableFromServer3 must be defined!
		params.arg1 = this.initializedVariableFromServer2;
		params.arg2 = this.initializedVariableFromServer3;
		return httpRequest(params);
	};
	
	this.initialize();
	
	function httpRequest (parameters) {
		return RSVP.Promise(function (resolve, reject) {
			$.ajax({
				url: parameters.url,
				method: parameters.method,
				headers: parameters.headers,
				success: function (responseJSON, arg2, arg3) {
					resolve(responseJSON);
				},
				error: function (arg1, arg2, arg3) {
					reject(arg1);
				}
			});
		});
	}
}