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
1becef4e
authored
2013-09-29 17:28:27 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Make sure that we properly unsubscribe from any outdated portions of a keypath.
1 parent
82c6c4d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
src/keypath_observer.coffee
src/keypath_observer.coffee
View file @
1becef4
...
...
@@ -15,15 +15,15 @@ class KeypathObserver
current
=
@
view
.
adapters
[
@
root
.
interface
].
read
@
view
.
models
,
@
root
.
path
for
token
,
index
in
@
tokens
next
=
@
view
.
adapters
[
token
.
interface
].
read
current
,
token
.
path
if
@
objectPath
[
index
]
?
if
next
isnt
@
objectPath
[
index
]
@
view
.
adapters
[
token
.
interface
].
unsubscribe
current
,
token
.
path
,
@
update
@
view
.
adapters
[
token
.
interface
].
subscribe
next
,
token
.
path
,
@
update
if
current
isnt
prev
=
@
objectPath
[
index
]
@
view
.
adapters
[
token
.
interface
].
unsubscribe
prev
,
token
.
path
,
@
update
@
view
.
adapters
[
token
.
interface
].
subscribe
current
,
token
.
path
,
@
update
@
objectPath
[
index
]
=
current
else
@
view
.
adapters
[
token
.
interface
].
subscribe
current
,
token
.
path
,
@
update
@
objectPath
[
index
]
=
current
current
=
next
current
=
@
view
.
adapters
[
token
.
interface
].
read
current
,
token
.
path
current
...
...
Please
register
or
sign in
to post a comment