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.
problem state i just discovered...
@data@document.dataref.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
DocumentRefat all now. I think theval()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.