Track the current NativeWatcher assigned to a Watcher

This commit is contained in:
Ash Wilson
2017-06-21 10:22:13 -04:00
parent 8d86acf19c
commit 9f518736e1

View File

@@ -142,6 +142,7 @@ class Watcher {
constructor (watchedPath) {
this.watchedPath = watchedPath
this.normalizedPath = null
this.native = null
this.emitter = new Emitter()
this.subs = new CompositeDisposable()
@@ -157,6 +158,7 @@ class Watcher {
attachToNative (native) {
this.subs.dispose()
this.native = native
if (native.isRunning()) {
this.emitter.emit('did-start')