mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Pass previous value to the callback in config.observe()
This commit is contained in:
@@ -207,8 +207,9 @@ class Config
|
||||
updateCallback = =>
|
||||
value = @get(keyPath)
|
||||
unless _.isEqual(value, previousValue)
|
||||
previous = previousValue
|
||||
previousValue = _.clone(value)
|
||||
callback(value)
|
||||
callback(value, {previous})
|
||||
|
||||
subscription = { cancel: => @off 'updated', updateCallback }
|
||||
@on 'updated', updateCallback
|
||||
|
||||
Reference in New Issue
Block a user