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 ES2017

This has been added in ES2017
This has been added in TypeScript 2.1


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




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