Are there promises on Google Apps Script?

前端 未结 3 685
后悔当初
后悔当初 2020-12-19 08:47

I have a form that my users enter data and I use onFormSubmit to trigger a script that creates a CSV based on the data inserted and after I create the CSV file I delete the

3条回答
  •  北海茫月
    2020-12-19 09:47

    There are no native Promises in GAS. With that said you can write your code in ES6/ESnext and make use of promises that way. To see how you can configure modules to expose the to the global scope see my comment here.

    By doing this you can take advantage of promises. With that said depending on the size of your project this may be overkill. In such a case I'd advise using simple callbacks if possible.

提交回复
热议问题