📝 Clean up Config::observe

This commit is contained in:
Lee Dohm 2014-05-14 21:15:17 -07:00
parent 333c5b66d1
commit 37241a7919

View File

@ -222,11 +222,12 @@ class Config
#
# keyPath - The {String} name of the key to observe
# options - An optional {Object} containing the `callNow` key.
# callback - The {Function} that fires when the. It is given a single argument, `value`,
# which is the new value of `keyPath`.
# callback - The {Function} that fires when the value of the key is
# changed. It is given a single argument, `value`, which is
# the new value of `keyPath`.
#
# Returns an {Object} with the following keys:
# :off - A {Function} that unobserves the `keyPath` with called.
# :off - A {Function} that unobserves the `keyPath` when called.
observe: (keyPath, options={}, callback) ->
if _.isFunction(options)
callback = options