當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript fs.unwatchFile函數代碼示例

本文整理匯總了TypeScript中fs.unwatchFile函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript unwatchFile函數的具體用法?TypeScript unwatchFile怎麽用?TypeScript unwatchFile使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了unwatchFile函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: setTimeout

    const onSourceChanged = (curr: fs.Stats, prev :fs.Stats) => {
      // console.log(process.pid, 'server changed')
      for (let filename of selfSourceFiles) {
        fs.unwatchFile(filename)
      }

      for (let filename of sourceFiles) {
        fs.unwatchFile(filename)
      }

      if (process.env.IS_SUBPROCESS) {
        process.exit(0)
        return
      }

      if (isClosing) {
        return
      }
      isClosing = true

      if (httpServer) {
        // console.log(process.pid, 'closing server', httpServer.listening)
        httpServer.close(() => {
          setTimeout(restartAsSubproc, 100)
        })
        httpServer.unref()
      } else {
        setTimeout(restartAsSubproc, 100)
      }
    }
開發者ID:rsms,項目名稱:co,代碼行數:30,代碼來源:parse-debugger.ts

示例2: watchFile

 watchFile('testfile', {persistent: false, interval: 1000}, (curr, prev) => {
   expect(curr.size).toBe(16);
   expect(prev.size).toBe(12);
   expect(zoneASpec.onScheduleTask).toHaveBeenCalled();
   expect(Zone.current.name).toBe('A');
   unwatchFile('testfile');
   unlink('testfile', () => {
     done();
   });
 });
開發者ID:jahtalab,項目名稱:zone.js,代碼行數:10,代碼來源:fs.spec.ts

示例3: unwatchFile

      .then(() => {
        unwatchFile(readyFile);

        // We have to watch for errors until the tunnel has started
        // successfully at which point we only want to watch for
        // status messages to emit
        readMessage = readStatus;

        readRunningMessage('');
        readMessage = undefined;
      })
開發者ID:theintern,項目名稱:digdug,代碼行數:11,代碼來源:SauceLabsTunnel.ts

示例4: watchFile

      watchFile(readyFile, { persistent: false, interval: 1007 }, function(
        current,
        previous
      ) {
        if (Number(current.mtime) === Number(previous.mtime)) {
          // readyFile hasn't been modified, so ignore the event
          return;
        }

        unwatchFile(readyFile);
        resolve();
      });
開發者ID:theintern,項目名稱:digdug,代碼行數:12,代碼來源:TestingBotTunnel.ts

示例5: close

                watchFile: (fileName, callback) => {
                    // watchFile polls a file every 250ms, picking up file notifications.
                    _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged);

                    return {
                        close() { _fs.unwatchFile(fileName, fileChanged); }
                    };

                    function fileChanged(curr: any, prev: any) {
                        if (+curr.mtime <= +prev.mtime) {
                            return;
                        }

                        callback(fileName);
                    };
                },
開發者ID:GrimoireGL,項目名稱:atom-typescript,代碼行數:16,代碼來源:sys.ts

示例6:

 close: () => _fs.unwatchFile(fileName, fileChanged)
開發者ID:8Observer8,項目名稱:TypeScript,代碼行數:1,代碼來源:sys.ts

示例7: unwatch

	/** Clears callbacks added with onModify(). */
	unwatch() {
		fs.unwatchFile(this.path);
	}
開發者ID:AdmiralZachbar,項目名稱:Pokemon-Showdown,代碼行數:4,代碼來源:fs.ts


注:本文中的fs.unwatchFile函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。