How to use the watch.watch.apply function in watch

To help you get started, we’ve selected a few watch 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 timoxley / react / index.js View on Github external
Emitter(target)
  }

  var onWatch = function(prop, action, newValue, oldValue) {
    target[prop] = newValue
    target.emit('change', prop, newValue, oldValue, action) // generic 'change'
    target.emit('change ' + prop, newValue, oldValue, action) // reactive compatible
  }
  // properties is optional and we only want to spply `watch`
  // with them if they are present.
  var args = []
  args.push(source)
  properties && args.push(properties)
  args.push(onWatch)
  args.push(1)
  watch.apply(undefined, args)
  return target
}

watch

Utilities for watching file trees.

Apache-2.0
Latest version published 8 years ago

Package Health Score

68 / 100
Full package analysis