This object is one of the most important aspects of the WinJS library, and instances of promise are involved with anything we do with asynchronous APIs. Let us dive into the details of this object. In terms of anatomy, the promise object includes the following three types of members.
At the level of constructors in WinJS, a class is created using the
WinJS.Class.define function. In this first parameter is a function that acts as the constructor. Now, in the case of the
Promise class, it is derived from a base class called
PromiseStateMachine using the
WinJS.Class.derive function, whose second parameter is the constructor function. In both cases, constructor functions can be named anything; alternatively, ...