Skip to content

Update array on bind (issue #19) #20

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

Closed
wants to merge 5 commits into from
Closed

Update array on bind (issue #19) #20

wants to merge 5 commits into from

Conversation

lunardog
Copy link

$bindAsArray fails to update if used after $unbind on the same key. Array items arrive from Firebase, but the property doesn’t show change, array looks empty.

Use case: same Vue component changes its reference during its lifetime.

@lunardog
Copy link
Author

Suddenly, I'm having an "infinite watch" warning in my project. Could it be caused by the $delete?

@harrysbaraini
Copy link

@lunardog I am using your changes on my project, and I was having "infinite watch" too, but I found I was returning a value in my "watch" function.

@lunardog
Copy link
Author

I think there's a danger to the use case I suggested: when we re-bind, the events stay. I added the delete on the reactive prop, but not on the firebase events for value and child_*.

Reject?

@posva
Copy link
Member

posva commented Jul 29, 2016

I'm taking a look into this. There's actually an easier way than deleting the key using Vue.delete, I'll post a PR with more tests for it. I hope you don't mind I pick your test and modify it a bit 😄

@posva posva mentioned this pull request Jul 29, 2016
@lunardog
Copy link
Author

No problem, @posva. Thank you for taking care of this. I see you check if vm[key] is undefined before binding. That is indeed more elegant.

I'll close this PR.

@lunardog lunardog closed this Jul 30, 2016
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

Successfully merging this pull request may close these issues.

3 participants