428746bd by Michael Richards

Fix typos and issues related to unobserving array mutations.

1 parent 07f88cf7
......@@ -45,7 +45,8 @@ Rivets.adapters['.'] =
map.pointers[ref].push keypath
unobserveMutations: (obj, ref, keypath) ->
if keyapths = @weakReference(obj).pointers?[ref]
if Array.isArray obj and obj[@id]?
if keypaths = @weakReference(obj).pointers?[ref]
keypaths.splice keypaths.indexOf(keypath), 1
subscribe: (obj, keypath, callback) ->
......@@ -71,7 +72,7 @@ Rivets.adapters['.'] =
unsubscribe: (obj, keypath, callback) ->
callbacks = @weakmap[obj[@id]].callbacks[keypath]
callbacks.splice callbacks.indexOf(callback), 1
@observeMutations obj[keypath], obj[@id], keypath
@unobserveMutations obj[keypath], obj[@id], keypath
read: (obj, keypath) ->
obj[keypath]
......