How to use the pathwatcher.watch function in pathwatcher

To help you get started, we’ve selected a few pathwatcher examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github atom / github / lib / git / git-service.js View on Github external
this.gitRepo.getPath().then(gitDirPath => {
      // Watch the git dir path. We're really just interested in the index file,
      // but watching it directly is Tricky because it's written atomically
      // which looks like a delete + create.
      const watcher = PatchWatcher.watch(gitDirPath, () => this.didChange())
      this.subscriptions.add(new Disposable(() => watcher.close()))
    })
  }
github atom / github / lib / git / git-service.js View on Github external
this.gitRepo.getPath().then(gitDirPath => {
      // Watch the git dir path. We're really just interested in the index file,
      // but watching it directly is Tricky because it's written atomically
      // which looks like a delete + create.
      const watcher = PatchWatcher.watch(gitDirPath, () => this.didChange())
      this.subscriptions.add(new Disposable(() => watcher.close()))
    })
  }
github nylas-mail-lives / nylas-mail / src / compile-support / cjsx.js View on Github external
setTimeout(function(){
      var pathwatcher = require('pathwatcher');
      pathwatcher.watch(module.filename, /*{persistent: true},*/ function () {
        clearTimeout(timeout);
        timeout = setTimeout(function () {
          hotCompile(module, module.filename, true);
          console.log('hot reloaded '+module.filename);
        }, 100);
      });
    },100);
  }
github nylas-mail-lives / nylas-mail / packages / client-app / src / theme-manager.es6 View on Github external
stylePaths.forEach((stylePath) => {
        if (!stylePath.endsWith('.less')) {
          return;
        }
        PathWatcher.watch(stylePath, () => {
          const styleEl = document.head.querySelector(`[source-path="${stylePath}"]`);
          styleEl.textContent = this.loadStylesheet(styleEl.sourcePath, true);
        });
      });
    };

pathwatcher

Watch files and directories for changes

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages