code: function watch(dir, type, callback) {
    const subscription = Date.now().toString(ALPHANUMERIC_BASE);
  
    client.capabilityCheck({ optional: [], required: ['relative_root'] }, capabilityErr => {
      if (capabilityErr) {
        client.end();
  
        return (0, _logger.logError)(capabilityErr);
      }
  
      client.command(['watch-project', dir], (watchErr, { watch: watcher, relative_path: relative_root, warning }) => {
        if (watchErr) {
          return (0, _logger.logError)(watchErr);
        }
  
        if (warning) {
          (0, _logger.log)(yellow('Warning: ', warning));
        }
  
        client.command(['clock', watcher], (clockErr, { clock: since }) => {
          if (clockErr) {
            return (0, _logger.logError)(clockErr);
          }
  
          client.command(['subscribe', watcher, subscription, {
            expression: ['suffix', type],
            since,
            relative_root
          }], subscribeErr => {
            if (subscribeErr) {
              (0, _logger.logError)(subscribeErr);
            }
          });
  
          client.on('subscription', subscriptionResp => {
            if (subscription === subscriptionResp.subscription) {
              callback(subscriptionResp);
            }
          });
        });
      });
    });
  }
docs: Using the [Facebook Watchman](https://facebook.github.io/watchman/), watches the directory `dir` for changes of files
  with extension `type` and runs `callback` when a change is detected.
  
  This watcher's only goal is performance, hence the simplicity.
  
  @function watch
  @param {string}        dir      - a full system path to a directory to watch
  @param {string}        type     - a file extension
  @param {WatchCallback} callback - a callback function
  @see {@link https://facebook.github.io/watchman/ Watchman}
  @example
  import {watch} from 'webcompiler';
  // or - import {watch} from 'webcompiler/lib/watch';
  // or - var watch = require('webcompiler').watch;
  // or - var watch = require('webcompiler/lib/watch').watch;
  import {join} from 'path';
  
  watch(join(__dirname, 'src'), 'js', someFunction);