mirror of
https://github.com/atom/atom.git
synced 2026-02-10 14:45:11 -05:00
add $native.unwatch(path, id)
This commit is contained in:
@@ -27,10 +27,10 @@ class Directory
|
||||
@unsubscribeFromNativeChangeEvents() if @subscriptionCount() == 0
|
||||
|
||||
subscribeToNativeChangeEvents: ->
|
||||
$native.watchPath @path, (eventTypes) =>
|
||||
@watchId = $native.watchPath @path, (eventTypes) =>
|
||||
@trigger 'contents-change' if eventTypes.modified?
|
||||
|
||||
unsubscribeFromNativeChangeEvents: ->
|
||||
$native.unwatchPath(@path)
|
||||
$native.unwatchPath(@path, @watchId)
|
||||
|
||||
_.extend Directory.prototype, EventEmitter
|
||||
|
||||
Reference in New Issue
Block a user