【发布时间】:2020-05-01 02:35:50
【问题描述】:
我正在阅读this article 上关于 Javascript 中的承诺链接,并且对它所说的 how can we do something after the avatar has finished showing and gets removed? For instance, we’d like to show a form for editing that user or something else. As of now, there’s no way. 部分感到困惑
图像被删除后我们不能做某事的原因是img.remove() 没有返回承诺吗?还是setTimeout在回调完成后没有返回任何东西?
【问题讨论】:
-
you can't set code to execute after the callback of setTimeout?因为它异步运行 - 在回调中做你需要的事情
标签: javascript asynchronous promise es6-promise asynchronous-javascript