I’m not very familiar with how to writePromise
. I hope I can encapsulate some common states ofreject
andresolve
. How can I write it better?
And the followingwriteFile
Is it better to write it directly as a normal function? Sorry for posting the long code, please help. . . . Thanks
Asynchronous operations are best to require
promise
或者Generator
函数 或者是async
functionsJiang Zi is simpler! Then put all the data processing logic inside the calling
then
或者catch