提交 3dded631 编写于 作者: J Johannes Rieken

debt - use native promise for pfs#whenDeleted

上级 fec5e17f
......@@ -182,10 +182,10 @@ export function del(path: string, tmp = getTmpDir()): Promise<void> {
return nfcall(extfs.del, path, tmp);
}
export function whenDeleted(path: string): TPromise<void> {
export function whenDeleted(path: string): Promise<void> {
// Complete when wait marker file is deleted
return new TPromise<void>(c => {
return new Promise<void>(resolve => {
let running = false;
const interval = setInterval(() => {
if (!running) {
......@@ -195,7 +195,7 @@ export function whenDeleted(path: string): TPromise<void> {
if (!exists) {
clearInterval(interval);
c(void 0);
resolve(void 0);
}
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册