Using Promises in JavaScript

added by kalyanms1
3/31/2013 12:01:16 AM


Promises in JavaScript gives you great power of asynchronicity while you are creating Windows 8 Apps or Web Applications. Promises gives you the ability to call something without blocking your UI thread. Instead of waiting for a call to return something, let that function fire when it complete. In this way you can continue the execution for the user. You are definitely need to know and use promises if you are going to develop Windows Apps. The reason is in Windows RT which is the API on windows where you develop the Apps. If a function might take more than 50 milliseconds then that is an asynchronous function. Windows team developed those functions as Asynchronous function, in order to use these functions you need to call them Asynchronously.