mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
🚱 Include namespace when canceling subscription
Emissary does not clear our namespace listeners when calling off with only the event name and the handler.
This commit is contained in:
parent
3e584f29b1
commit
feff67457d
@ -211,12 +211,12 @@ class Config
|
||||
previousValue = _.clone(value)
|
||||
callback(value, {previous})
|
||||
|
||||
subscription = { cancel: => @off 'updated', updateCallback }
|
||||
@on "updated.#{keyPath.replace(/\./, '-')}", updateCallback
|
||||
eventName = "updated.#{keyPath.replace(/\./, '-')}"
|
||||
subscription = { cancel: => @off eventName, updateCallback }
|
||||
@on eventName, updateCallback
|
||||
callback(value) if options.callNow ? true
|
||||
subscription
|
||||
|
||||
|
||||
# Public: Unobserve all callbacks on a given key
|
||||
#
|
||||
# keyPath - The {String} name of the key to unobserve
|
||||
|
Loading…
Reference in New Issue
Block a user