Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
428746bd
authored
2013-09-10 15:41:55 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix typos and issues related to unobserving array mutations.
1 parent
07f88cf7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
src/adapters.coffee
src/adapters.coffee
View file @
428746b
...
...
@@ -45,8 +45,9 @@ Rivets.adapters['.'] =
map
.
pointers
[
ref
].
push
keypath
unobserveMutations
:
(
obj
,
ref
,
keypath
)
->
if
keyapths
=
@
weakReference
(
obj
).
pointers
?
[
ref
]
keypaths
.
splice
keypaths
.
indexOf
(
keypath
),
1
if
Array
.
isArray
obj
and
obj
[
@
id
]
?
if
keypaths
=
@
weakReference
(
obj
).
pointers
?
[
ref
]
keypaths
.
splice
keypaths
.
indexOf
(
keypath
),
1
subscribe
:
(
obj
,
keypath
,
callback
)
->
callbacks
=
@
weakReference
(
obj
).
callbacks
...
...
@@ -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
@
un
observeMutations
obj
[
keypath
],
obj
[
@
id
],
keypath
read
:
(
obj
,
keypath
)
->
obj
[
keypath
]
...
...
Please
register
or
sign in
to post a comment