Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider removing all data from DocumentRefs #20

Open
scien opened this issue Oct 22, 2014 · 0 comments
Open

consider removing all data from DocumentRefs #20

scien opened this issue Oct 22, 2014 · 0 comments
Assignees

Comments

@scien
Copy link
Contributor

scien commented Oct 22, 2014

problem state i just discovered...

  • data is updated
  • ref catches update and changes its @data
  • ref emits event
  • event handler used ref.get('property').val() // ISSUE: property was out of date
  • ref updates @document.data

ref.get passes the document and the path, it ignores local data, so the document data had to be updated before emitting events. I can't think of any benefit to duplicating the data in the DocumentRef at all now. I think the val() call should just always ask the document what the value at its path is.

only tricky thing i can think of is if you have a ref listener it would have to tell the document to update that part of its data. going to sit on this for a little bit and think it over.

@scien scien self-assigned this Oct 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant