async / await

This is a new way of writing asynchronous code
Before this you could use either Callbacks or Promises.
This is built on top of promises.
This approach means your asynchronous code looks and behave more like synchronous code.


Added in ES8 (or ESMAScript 2017)

This was also added in TypeScript 2.1


Excel.run(async function (context) { 
   //stuff
   await context.sync();
   //more stuff
   await context.sync();
   //more stuff
   await context.sync();
})
.catch(error) {
   OfficeHelper.Utilities.log(error);
}




© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext